mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 19:38:20 -07:00
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
|
Prism.languages.markup = {
|
||
|
'comment': /<!--[\w\W]*?-->/,
|
||
|
'prolog': /<\?[\w\W]+?\?>/,
|
||
|
'doctype': /<!DOCTYPE[\w\W]+?>/,
|
||
|
'cdata': /<!\[CDATA\[[\w\W]*?]]>/i,
|
||
|
'tag': {
|
||
|
pattern: /<\/?(?!\d)[^\s>\/=.$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,
|
||
|
inside: {
|
||
|
'tag': {
|
||
|
pattern: /^<\/?[^\s>\/]+/i,
|
||
|
inside: {
|
||
|
'punctuation': /^<\/?/,
|
||
|
'namespace': /^[^\s>\/:]+:/
|
||
|
}
|
||
|
},
|
||
|
'attr-value': {
|
||
|
pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,
|
||
|
inside: {
|
||
|
'punctuation': /[=>"']/
|
||
|
}
|
||
|
},
|
||
|
'punctuation': /\/?>/,
|
||
|
'attr-name': {
|
||
|
pattern: /[^\s>\/]+/,
|
||
|
inside: {
|
||
|
'namespace': /^[^\s>\/:]+:/
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
},
|
||
|
'entity': /&#?[\da-z]{1,8};/i
|
||
|
};
|
||
|
|
||
|
// 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;
|