This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/highlight.js/lib/languages/tex.js

61 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
module.exports = function(hljs) {
var COMMAND = {
className: 'tag',
begin: /\\/,
relevance: 0,
contains: [
{
className: 'name',
variants: [
{begin: /[a-zA-Z\u0430-\u044f\u0410-\u042f]+[*]?/},
{begin: /[^a-zA-Z\u0430-\u044f\u0410-\u042f0-9]/}
],
starts: {
endsWithParent: true,
relevance: 0,
contains: [
{
className: 'string', // because it looks like attributes in HTML tags
variants: [
{begin: /\[/, end: /\]/},
{begin: /\{/, end: /\}/}
]
},
{
begin: /\s*=\s*/, endsWithParent: true,
relevance: 0,
contains: [
{
className: 'number',
begin: /-?\d*\.?\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?/
}
]
}
]
}
}
]
};
return {
contains: [
COMMAND,
{
className: 'formula',
contains: [COMMAND],
relevance: 0,
variants: [
{begin: /\$\$/, end: /\$\$/},
{begin: /\$/, end: /\$/}
]
},
hljs.COMMENT(
'%',
'$',
{
relevance: 0
}
)
]
};
};