Support extracting content from data url#94
Conversation
|
Hello @ttimasdf! I ask that you please read the contributing guidelines. https://github.com/jonkemp/inline-css/blob/master/CONTRIBUTING.md#feature-requests Specifically, this section:
I have no idea if your pull request addresses a bug or is a feature request, so please ask first before making a pull request, or at least provide more context. Thank you! |
|
Sorry, I've been working on other projects that almost forgot this PR. I'll add some contexts. @jonkemp I consider this PR a bug fix that it handles the case that the CSS data is embedded in the corresponding HTML tag. The following file is an HTML page generated by VSCode Plugin Markdown Extended , from a markdown file with random content with a custom CSS theme. Test.html.txt (Github is limiting file extension so remove part of the file content as follows <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test.md</title>
<!-- official styles start -->
<!-- markdown.css -->
<link rel="stylesheet" type="text/css" href="data:text/css;base64,LyotLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0KICogIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLiBBbGwgcmlna
HRzIHJlc2VydmVkLgogKiAgTGljZW5zZ...
The current version will fail with some DNS related issues. Maybe it thinks |
Expected behaviour:
Extract CSS stylesheet data from base64 encoded string.
I'm not familiar with JS so I'm not sure whether I'm using the right way to invoke callback function 😅 feel free to change the codes.