feat(prism): define hex/binary langs for better highlighting

This commit is contained in:
Oliver Booth 2023-08-14 00:58:32 +01:00
parent e7cbe0330b
commit b9e2597bc0
Signed by: oliverbooth
GPG Key ID: B89D139977693FED
1 changed files with 12 additions and 0 deletions

View File

@ -10,6 +10,18 @@ declare const Prism: any;
(() => {
Prism.languages.extend('markup', {});
Prism.languages.hex = {
'number': {
pattern: /(?:[a-f0-9]{3}){1,2}\b/i,
lookbehind: true
}
};
Prism.languages.binary = {
'number': {
pattern: /[10]+/i,
lookbehind: true
}
};
Prism.languages.insertBefore('custom', 'tag', {
'mark': {
pattern: /<\/?mark(?:\s+\w+(?:=(?:"[^"]*"|'[^']*'|[^\s'">=]+))?\s*|\s*)\/?>/,