diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-13 11:51:22 (EST) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-13 11:51:22 (EST) |
commit | bfbcc54c2f93a7d7a52c1897f7a711c02e6454b0 (patch) | |
tree | cf3910200c3bcd922abb7cb8d1723ee1e8d22852 /data/resources/prism/components/prism-markup.jsin | |
parent | e42fa02e77211074ba6f7d80f8ea86edfc4a7d0e (diff) | |
download | marquee-bfbcc54c2f93a7d7a52c1897f7a711c02e6454b0.zip marquee-bfbcc54c2f93a7d7a52c1897f7a711c02e6454b0.tar.gz marquee-bfbcc54c2f93a7d7a52c1897f7a711c02e6454b0.tar.bz2 |
data/resources/prism: Rename * source files to *in
Diffstat (limited to 'data/resources/prism/components/prism-markup.jsin')
-rw-r--r-- | data/resources/prism/components/prism-markup.jsin | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/data/resources/prism/components/prism-markup.jsin b/data/resources/prism/components/prism-markup.jsin new file mode 100644 index 0000000..1dafd24 --- /dev/null +++ b/data/resources/prism/components/prism-markup.jsin @@ -0,0 +1,55 @@ +Prism.languages.markup = { + 'comment': /<!--[\s\S]*?-->/, + 'prolog': /<\?[\s\S]+?\?>/, + 'doctype': /<!DOCTYPE[\s\S]+?>/i, + 'cdata': /<!\[CDATA\[[\s\S]*?]]>/i, + 'tag': { + pattern: /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i, + inside: { + 'tag': { + pattern: /^<\/?[^\s>\/]+/i, + inside: { + 'punctuation': /^<\/?/, + 'namespace': /^[^\s>\/:]+:/ + } + }, + 'attr-value': { + pattern: /=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i, + inside: { + 'punctuation': [ + /^=/, + { + pattern: /(^|[^\\])["']/, + lookbehind: true + } + ] + } + }, + 'punctuation': /\/?>/, + 'attr-name': { + pattern: /[^\s>\/]+/, + inside: { + 'namespace': /^[^\s>\/:]+:/ + } + } + + } + }, + 'entity': /&#?[\da-z]{1,8};/i +}; + +Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = + Prism.languages.markup['entity']; + +// Plugin to make entity title show the real entity, idea by Roman Komarov +Prism.hooks.add('wrap', function(env) { + + if (env.type === 'entity') { + env.attributes['title'] = env.content.replace(/&/, '&'); + } +}); + +Prism.languages.xml = Prism.languages.markup; +Prism.languages.html = Prism.languages.markup; +Prism.languages.mathml = Prism.languages.markup; +Prism.languages.svg = Prism.languages.markup; |