-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
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
WIP: Remove oniguruma dependency by replacing marky-markdown by markdown-it #73
Conversation
|
I'm happy with this solution if the rest of you all are! I did some brief testing - I can't seem to get syntax highlighting for code blocks to work. I tried GitHub markdown syntax, e.g.
I also tried it without the language specifier, seeing if it would autodetect. I can't find any documentation in either |
@jdormit 1) Selected one// Actual default values
var md = require('markdown-it')({
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(lang, str).value;
} catch (__) {}
}
return ''; // use external default escaping
}
}); 2) Not selected one (user needs to assign class to <pre>)// Actual default values
var md = require('markdown-it')({
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return '<pre class="hljs"><code>' +
hljs.highlight(lang, str, true).value +
'</code></pre>';
} catch (__) {}
}
return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
}
}); For
What's the correct one for
|
@zeke would be better placed to answer that question - I never did any syntax highlighted code blocks with |
I would prefer not to move off of When first writing marky-markdown I actually started with I would rather just get atom/node-oniguruma#66 sorted out instead. |
|
You are right. I did the tests and ...well, back to square one. Just as a reference, here are the tests results, TestsCode sample 1
Code sample 2
Results -
|
WIP: do not merge
This PR is just an option to solve de Node 4 support.
marky-markdown
dependency tomarkdown-it
+markdown-it-named-headers
+highlight.js