@tanstack/highlight
Version:
Tiny class-based syntax highlighting for documentation.
12 lines (11 loc) • 609 B
JavaScript
// Vocabulary adapted from Highlight.js 11.11.1, see NOTICE.md.
import { simpleLanguage } from '../internal/simple-language.js';
export const graphql = /* @__PURE__ */ simpleLanguage({
name: "graphql",
aliases: ["gql"],
comments: /*/,
strings: /"""[\s\S]*?(?:"""|(?![\s\S]))|"(?:\\[\s\S]|[^"\\])*(?:"|(?![\s\S]))/,
keywords: "query mutation subscription type input schema directive interface union scalar fragment enum on",
literals: "true false null",
beforeWords: [{ className: 'variable', regex: /\$[A-Za-z_]\w*/g }, { className: 'attr', regex: /@[A-Za-z_]\w*/g }],
});