Locally add prismjs
This commit is contained in:
parent
35af792c6a
commit
6aa044cf9b
701 changed files with 35787 additions and 0 deletions
21
node_modules/prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js
generated
vendored
Normal file
21
node_modules/prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
(function () {
|
||||
|
||||
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
Prism.hooks.add('before-sanity-check', function (env) {
|
||||
if (env.code) {
|
||||
var pre = env.element.parentNode;
|
||||
var clsReg = /(?:^|\s)keep-initial-line-feed(?:\s|$)/;
|
||||
if (
|
||||
pre && pre.nodeName.toLowerCase() === 'pre' &&
|
||||
// Apply only if nor the <pre> or the <code> have the class
|
||||
(!clsReg.test(pre.className) && !clsReg.test(env.element.className))
|
||||
) {
|
||||
env.code = env.code.replace(/^(?:\r?\n|\r)/, '');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}());
|
1
node_modules/prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js
generated
vendored
Normal file
1
node_modules/prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
"undefined"!=typeof Prism&&"undefined"!=typeof document&&Prism.hooks.add("before-sanity-check",(function(e){if(e.code){var n=e.element.parentNode,o=/(?:^|\s)keep-initial-line-feed(?:\s|$)/;!n||"pre"!==n.nodeName.toLowerCase()||o.test(n.className)||o.test(e.element.className)||(e.code=e.code.replace(/^(?:\r?\n|\r)/,""))}}));
|
Loading…
Add table
Add a link
Reference in a new issue