Skip to content

Commit

Permalink
Merge branch 'gh-pages' of https://github.com/dfitiskin/prism into df…
Browse files Browse the repository at this point in the history
…itiskin-gh-pages

# Conflicts:
#	plugins/line-numbers/prism-line-numbers.js
  • Loading branch information
Golmote committed Sep 9, 2017
2 parents 0621ff7 + 8ddcc96 commit 3fb7cf8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/line-numbers/prism-line-numbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

if (clsReg.test(env.element.className)) {
// Remove the class "line-numbers" from the <code>
env.element.className = env.element.className.replace(clsReg, '');
env.element.className = env.element.className.replace(clsReg, ' ');
}
if (!clsReg.test(pre.className)) {
// Add the class "line-numbers" to the <pre>
Expand Down
8 changes: 8 additions & 0 deletions plugins/unescaped-markup/prism-unescaped-markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@

pre.className = code.className = env.element.className;

if (env.element.dataset) {
Object.keys(env.element.dataset).forEach(function (key) {
if (Object.prototype.hasOwnProperty.call(env.element.dataset, key)) {
pre.dataset[key] = env.element.dataset[key];
}
});
}

env.code = env.code.replace(/&lt;\/script(>|&gt;)/gi, "</scri" + "pt>");
code.textContent = env.code;

Expand Down

0 comments on commit 3fb7cf8

Please sign in to comment.