diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-13 19:32:56 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:14:41 +0100 |
| commit | 006b15b467a5cd835a6eab1b49023100bdc8f2e6 (patch) | |
| tree | 949c7295c2e206f42357f135bab4696ddf6576ec /public/prism/prism-javadoclike.min.js | |
| parent | 00f147a7a687d5772bcc538bc606cfff972178cd (diff) | |
refactor(components): rewrite Code component and usePrism hook
* move Prism styles to Sass placeholders to avoid repeats
* let usePrism consumer define its plugins (remove default ones)
* remove `plugins` prop from Code component
* add new props to Code component to let consumer configure plugins
(and handle plugin list from the given options)
However there are some problems with Prism plugins: line-highlight and
treeview does not seems to be loaded. I don't want to use Babel instead
of SWC so I have no solution for now.
Diffstat (limited to 'public/prism/prism-javadoclike.min.js')
| -rw-r--r-- | public/prism/prism-javadoclike.min.js | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/public/prism/prism-javadoclike.min.js b/public/prism/prism-javadoclike.min.js index 782f3f1..0477366 100644 --- a/public/prism/prism-javadoclike.min.js +++ b/public/prism/prism-javadoclike.min.js @@ -1,5 +1,5 @@ -!(function (p) { - var a = (p.languages.javadoclike = { +!(function (a) { + var e = (a.languages.javadoclike = { parameter: { pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m, lookbehind: !0, @@ -10,38 +10,36 @@ }, punctuation: /[{}]/, }); - Object.defineProperty(a, 'addSupport', { - value: function (a, e) { - 'string' == typeof a && (a = [a]), - a.forEach(function (a) { - !(function (a, e) { - var n = 'doc-comment', - t = p.languages[a]; - if (t) { - var r = t[n]; - if (!r) { - var o = { - 'doc-comment': { - pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/, - lookbehind: !0, - alias: 'comment', - }, - }; - r = (t = p.languages.insertBefore(a, 'comment', o))[n]; - } + Object.defineProperty(e, 'addSupport', { + value: function (e, n) { + 'string' == typeof e && (e = [e]), + e.forEach(function (e) { + !(function (e, n) { + var t = 'doc-comment', + r = a.languages[e]; + if (r) { + var o = r[t]; if ( - (r instanceof RegExp && (r = t[n] = { pattern: r }), - Array.isArray(r)) + (o || + (o = (r = a.languages.insertBefore(e, 'comment', { + 'doc-comment': { + pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/, + lookbehind: !0, + alias: 'comment', + }, + }))[t]), + o instanceof RegExp && (o = r[t] = { pattern: o }), + Array.isArray(o)) ) - for (var i = 0, s = r.length; i < s; i++) - r[i] instanceof RegExp && (r[i] = { pattern: r[i] }), e(r[i]); - else e(r); + for (var i = 0, s = o.length; i < s; i++) + o[i] instanceof RegExp && (o[i] = { pattern: o[i] }), n(o[i]); + else n(o); } - })(a, function (a) { - a.inside || (a.inside = {}), (a.inside.rest = e); + })(e, function (a) { + a.inside || (a.inside = {}), (a.inside.rest = n); }); }); }, }), - a.addSupport(['java', 'javascript', 'php'], a); + e.addSupport(['java', 'javascript', 'php'], e); })(Prism); |
