mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
7f37ba737c
* Update Copybara options in preparation for open-sourcing the source editor * Move files * Update paths * Remove source-editor module and checks for its existence * Explicitly mention CM6 license in files that contain code adapted from CM6 GitOrigin-RevId: 89b7cc2b409db01ad103198ccbd1b126ab56349b
49 lines
1.9 KiB
TypeScript
49 lines
1.9 KiB
TypeScript
/**
|
|
* This file is adapted from Lezer, licensed under the MIT license:
|
|
* https://github.com/lezer-parser/highlight/blob/main/src/highlight.ts
|
|
*/
|
|
import { tagHighlighter, tags } from '@lezer/highlight'
|
|
|
|
export const classHighlighter = tagHighlighter([
|
|
{ tag: tags.link, class: 'tok-link' },
|
|
{ tag: tags.heading, class: 'tok-heading' },
|
|
{ tag: tags.emphasis, class: 'tok-emphasis' },
|
|
{ tag: tags.strong, class: 'tok-strong' },
|
|
{ tag: tags.keyword, class: 'tok-keyword' },
|
|
{ tag: tags.atom, class: 'tok-atom' },
|
|
{ tag: tags.bool, class: 'tok-bool' },
|
|
{ tag: tags.url, class: 'tok-url' },
|
|
{ tag: tags.labelName, class: 'tok-labelName' },
|
|
{ tag: tags.inserted, class: 'tok-inserted' },
|
|
{ tag: tags.deleted, class: 'tok-deleted' },
|
|
{ tag: tags.literal, class: 'tok-literal' },
|
|
{ tag: tags.string, class: 'tok-string' },
|
|
{ tag: tags.number, class: 'tok-number' },
|
|
{
|
|
tag: [tags.regexp, tags.escape, tags.special(tags.string)],
|
|
class: 'tok-string2',
|
|
},
|
|
{ tag: tags.variableName, class: 'tok-variableName' },
|
|
{ tag: tags.local(tags.variableName), class: 'tok-variableName tok-local' },
|
|
{
|
|
tag: tags.definition(tags.variableName),
|
|
class: 'tok-variableName tok-definition',
|
|
},
|
|
{ tag: tags.special(tags.variableName), class: 'tok-variableName2' },
|
|
{
|
|
tag: tags.definition(tags.propertyName),
|
|
class: 'tok-propertyName tok-definition',
|
|
},
|
|
{ tag: tags.typeName, class: 'tok-typeName' },
|
|
{ tag: tags.namespace, class: 'tok-namespace' },
|
|
{ tag: tags.className, class: 'tok-className' },
|
|
{ tag: tags.macroName, class: 'tok-macroName' },
|
|
{ tag: tags.propertyName, class: 'tok-propertyName' },
|
|
{ tag: tags.operator, class: 'tok-operator' },
|
|
{ tag: tags.comment, class: 'tok-comment' },
|
|
{ tag: tags.meta, class: 'tok-meta' },
|
|
{ tag: tags.invalid, class: 'tok-invalid' },
|
|
{ tag: tags.punctuation, class: 'tok-punctuation' },
|
|
// additional
|
|
{ tag: tags.attributeValue, class: 'tok-attributeValue' },
|
|
])
|