mirror of
https://github.com/arsenetar/PrismHighlight.git
synced 2024-11-24 04:39:01 +00:00
26 lines
720 B
JavaScript
26 lines
720 B
JavaScript
Prism.languages.css = {
|
|
'comment': /\/\*[\w\W]*?\*\//g,
|
|
'atrule': /@[\w-]+?(\s+[^;{]+)?(?=\s*{|\s*;)/gi,
|
|
'url': /url\((["']?).*?\1\)/gi,
|
|
'selector': /[^\{\}\s][^\{\}]*(?=\s*\{)/g,
|
|
'property': /(\b|\B)[a-z-]+(?=\s*:)/ig,
|
|
'string': /("|')(\\?.)*?\1/g,
|
|
'important': /\B!important\b/gi,
|
|
'ignore': /&(lt|gt|amp);/gi,
|
|
'punctuation': /[\{\};:]/g
|
|
};
|
|
|
|
if (Prism.languages.markup) {
|
|
Prism.languages.insertBefore('markup', 'tag', {
|
|
'style': {
|
|
pattern: /(<|<)style[\w\W]*?(>|>)[\w\W]*?(<|<)\/style(>|>)/ig,
|
|
inside: {
|
|
'tag': {
|
|
pattern: /(<|<)style[\w\W]*?(>|>)|(<|<)\/style(>|>)/ig,
|
|
inside: Prism.languages.markup.tag.inside
|
|
},
|
|
rest: Prism.languages.css
|
|
}
|
|
}
|
|
});
|
|
} |