We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was trying to add code highlighting to a static html file and this does not seem to be working for me. Can you please add a Browser example like this? https://github.com/bent10/marked-extensions/tree/main/packages/code-format#browser
The text was updated successfully, but these errors were encountered:
Here is an example:
<html> <head> </head> <body> <script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script> <script src="https://cdn.jsdelivr.net/npm/marked-highlight/lib/index.umd.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/default.min.css"> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script> <script> const { Marked } = window.marked; const { markedHighlight } = window.markedHighlight; const marked = new Marked( markedHighlight({ langPrefix: 'hljs language-', highlight(code, lang, info) { const language = hljs.getLanguage(lang) ? lang : 'plaintext'; return hljs.highlight(code, { language }).value; } }) ); const div = document.createElement("div"); div.innerHTML = marked.parse(` \`\`\`javascript const highlight = "code"; \`\`\` `); document.body.append(div); </script> </body> </html>
Sorry, something went wrong.
Does IE 11 10 not support?
No, Microsoft doesn't even support them anymore.
No branches or pull requests
I was trying to add code highlighting to a static html file and this does not seem to be working for me. Can you please add a Browser example like this? https://github.com/bent10/marked-extensions/tree/main/packages/code-format#browser
The text was updated successfully, but these errors were encountered: