mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-79680 libraries: Upgrade PrismJS to 1.29.0
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
This commit is contained in:
parent
a75365f2e4
commit
793385b256
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1978,7 +1978,7 @@ delete Prism.languages.c['boolean'];
|
||||
Prism.languages.css = {
|
||||
'comment': /\/\*[\s\S]*?\*\//,
|
||||
'atrule': {
|
||||
pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
|
||||
pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
|
||||
inside: {
|
||||
'rule': /^@[\w-]+/,
|
||||
'selector-function-argument': {
|
||||
@ -2093,7 +2093,8 @@ delete Prism.languages.c['boolean'];
|
||||
'operator': {
|
||||
pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
|
||||
lookbehind: true
|
||||
}
|
||||
},
|
||||
'constant': /\b[A-Z][A-Z_\d]+\b/
|
||||
});
|
||||
|
||||
Prism.languages.insertBefore('java', 'string', {
|
||||
@ -2386,7 +2387,10 @@ Prism.languages.markup = {
|
||||
pattern: /^=/,
|
||||
alias: 'attr-equals'
|
||||
},
|
||||
/"|'/
|
||||
{
|
||||
pattern: /^(\s*)["']|["']$/,
|
||||
lookbehind: true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -3120,4 +3124,4 @@ Prism.languages.py = Prism.languages.python;
|
||||
window.Prism = oldprism;
|
||||
return Prism;
|
||||
}(undefined, undefined, undefined);
|
||||
export default prismjs;
|
||||
export default prismjs;
|
||||
|
@ -26,11 +26,14 @@ Prerequisite: Make sure the grunt watcher is running during the below process:
|
||||
|
||||
3. In the extracted folder, run "yarn".
|
||||
|
||||
4. Copy the node_modules/prismjs/themes/prism.css to yourmoodle/filter/codehighlighter/styles.css
|
||||
4. Update the PrismJS version in filter/codehighlighter/thirdpartylibs.xml according to the PrismJS version in the extracted
|
||||
folder in the file node_modules/prismjs/package.json.
|
||||
|
||||
5. Edit the styles.css to make sure the indentation is made using spaces, not tabs, and remove trailing spaces.
|
||||
5. Copy the node_modules/prismjs/themes/prism.css to yourmoodle/filter/codehighlighter/styles.css
|
||||
|
||||
6. To avoid conflict with the theme code tag style.
|
||||
6. Edit the styles.css to make sure the indentation is made using spaces, not tabs, and remove trailing spaces.
|
||||
|
||||
7. To avoid conflict with the theme code tag style.
|
||||
Remove all the lines that contain 'code[class*="language-"]' text in the styles.css,
|
||||
and also remove the comma character after the text if necessary to make sure that the CSS structure is correct.
|
||||
Please see the examples below:
|
||||
@ -42,7 +45,7 @@ Prerequisite: Make sure the grunt watcher is running during the below process:
|
||||
* code[class*="language-"] ::selection
|
||||
* code[class*="language-"]
|
||||
|
||||
7. See if the grunt watch is reporting problems. If yes, follow the instructions to fix it. e.g:
|
||||
8. See if the grunt watch is reporting problems. If yes, follow the instructions to fix it. e.g:
|
||||
|
||||
Before:
|
||||
```
|
||||
@ -61,10 +64,10 @@ Prerequisite: Make sure the grunt watcher is running during the below process:
|
||||
|
||||
And remove the warning from color-hex-case by renaming "#DD4A68" to lowercase "#dd4a68".
|
||||
|
||||
8. In the extracted folder, run "./bin/build-prism.js"
|
||||
9. In the extracted folder, run "./bin/build-prism.js"
|
||||
|
||||
9. Copy the node_modules/prismjs/prism.js to yourmoodle/filter/codehighlighter/amd/src/prism.js
|
||||
10. Copy the node_modules/prismjs/prism.js to yourmoodle/filter/codehighlighter/amd/src/prism.js
|
||||
|
||||
10. Edit the prism.js to make sure the indentation is made using spaces, not tabs, and remove trailing spaces.
|
||||
11. Edit the prism.js to make sure the indentation is made using spaces, not tabs, and remove trailing spaces.
|
||||
|
||||
Note: As long as the grunt watcher says Done, then the upgrade process is complete.
|
||||
|
@ -4,7 +4,7 @@
|
||||
<location>amd/src/prism.js</location>
|
||||
<name>PrismJS</name>
|
||||
<description>Prism is a lightweight, robust, and elegant syntax highlighting library. It's a spin-off project from Dabblet.</description>
|
||||
<version>1.16.0</version>
|
||||
<version>1.29.0</version>
|
||||
<license>MIT</license>
|
||||
<repository>https://github.com/PrismJS/prism</repository>
|
||||
<copyrights>
|
||||
|
Loading…
x
Reference in New Issue
Block a user