ISO-Share/node_modules/prismjs/components/prism-bbcode.js

30 lines
609 B
JavaScript
Raw Permalink Normal View History

2024-11-26 21:16:11 +01:00
Prism.languages.bbcode = {
'tag': {
pattern: /\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/,
inside: {
'tag': {
pattern: /^\[\/?[^\s=\]]+/,
inside: {
'punctuation': /^\[\/?/
}
},
'attr-value': {
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/,
inside: {
'punctuation': [
/^=/,
{
pattern: /^(\s*)["']|["']$/,
lookbehind: true
}
]
}
},
'punctuation': /\]/,
'attr-name': /[^\s=\]]+/
}
}
};
Prism.languages.shortcode = Prism.languages.bbcode;