You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the library along with Prism highlighting to render a notebook's content. It seems like the notebookjs library html-escapes the '<' and '>' characters before passing it to the highlighter. The highlighter treats it as the actual code and renders it as such by tokenising < and >
Anyway to disable escaping or any recommended way to handle this situation?
I am using the code given on the site to use prism highlighting. ie
`var Prism = require('prismjs');
var highlighter = function(code, lang) {
if (typeof lang === 'undefined') lang = 'markup';
Hi @uadarsh and thanks for your interest in this repository. Could you provide a simple, reproducible example that demonstrates the issue you're encountering? That would include a specific notebook as well as the code to render it.
I am trying to use the library along with Prism highlighting to render a notebook's content. It seems like the notebookjs library html-escapes the '<' and '>' characters before passing it to the highlighter. The highlighter treats it as the actual code and renders it as such by tokenising < and >
Anyway to disable escaping or any recommended way to handle this situation?
I am using the code given on the site to use prism highlighting. ie
`var Prism = require('prismjs');
var highlighter = function(code, lang) {
if (typeof lang === 'undefined') lang = 'markup';
};
var nb = require("notebookjs");
nb.highlighter = function(text, pre, code, lang) {
var language = lang || 'text';
pre.className = 'language-' + language;
if (typeof code != 'undefined') {
code.className = 'language-' + language;
}
return highlighter(text, language);
};`
The text was updated successfully, but these errors were encountered: