[#4106] added custom Prism.js bundle and registered new TinyMCE codesample languages

This commit is contained in:
Gani Georgiev
2024-01-13 16:13:16 +02:00
parent 036c0da05f
commit 2a28f6ff33
48 changed files with 975 additions and 606 deletions
+2 -7
View File
@@ -1,15 +1,10 @@
<script>
import Prism from "prismjs";
import "prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.js";
import "prismjs/components/prism-dart.js";
import "@/scss/prism_light.scss";
export let content = "";
export let language = "javascript"; // javascript, html, dart, go, sql
let classes = "";
export { classes as class }; // export reserved keyword
export let content = "";
export let language = "javascript"; // javascript, html
let formattedContent = "";
$: if (typeof Prism !== "undefined" && content) {
+26
View File
@@ -1433,6 +1433,32 @@ export default class CommonHelper {
"codesample",
"directionality",
],
codesample_global_prismjs: true,
codesample_languages: [
{ text: 'HTML/XML', value: 'markup' },
{ text: 'CSS', value: 'css' },
{ text: 'SQL', value: 'sql' },
{ text: 'JavaScript', value: 'javascript' },
{ text: 'Go', value: 'go' },
{ text: 'Dart', value: 'dart' },
{ text: 'Zig', value: 'zig' },
{ text: 'Rust', value: 'rust' },
{ text: 'Lua', value: 'lua' },
{ text: 'PHP', value: 'php' },
{ text: 'Ruby', value: 'ruby' },
{ text: 'Python', value: 'python' },
{ text: 'Java', value: 'java' },
{ text: 'C', value: 'c' },
{ text: 'C#', value: 'csharp' },
{ text: 'C++', value: 'cpp' },
// other non-highlighted languages
{ text: 'Markdown', value: 'markdown' },
{ text: 'Swift', value: 'swift' },
{ text: 'Kotlin', value: 'kotlin' },
{ text: 'Scala', value: 'scala' },
{ text: 'Julia', value: 'julia' },
{ text: 'Haskell', value: 'haskell' },
],
toolbar: "styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",
paste_postprocess: (editor, args) => {
cleanupPastedNode(args.node);