mirror of
https://github.com/kou029w/quot.git
synced 2025-01-19 00:18:09 +00:00
39 lines
744 B
TypeScript
39 lines
744 B
TypeScript
|
import { styleTags, tags as t } from "@lezer/highlight";
|
||
|
import {
|
||
|
HighlightStyle,
|
||
|
LRLanguage,
|
||
|
syntaxHighlighting,
|
||
|
} from "@codemirror/language";
|
||
|
import { parser } from "./quot.grammar.js";
|
||
|
|
||
|
export const quotLanguage = LRLanguage.define({
|
||
|
parser: parser.configure({
|
||
|
props: [
|
||
|
styleTags({
|
||
|
Heading: t.heading,
|
||
|
Indent: t.separator,
|
||
|
AutoLink: t.link,
|
||
|
}),
|
||
|
],
|
||
|
}),
|
||
|
});
|
||
|
|
||
|
export const quotHighlighting = syntaxHighlighting(
|
||
|
HighlightStyle.define([
|
||
|
{
|
||
|
tag: t.heading,
|
||
|
fontWeight: "bold",
|
||
|
fontSize: "1.25em",
|
||
|
marginBlockEnd: "0.5em",
|
||
|
},
|
||
|
{
|
||
|
tag: t.separator,
|
||
|
letterSpacing: "1.5em",
|
||
|
},
|
||
|
{
|
||
|
tag: t.link,
|
||
|
class: "auto-link",
|
||
|
},
|
||
|
])
|
||
|
);
|