Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions components/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56579,6 +56579,21 @@ var es_default = import_lib.default;
// components/src/asciidoc/Listing.tsx
var import_html_entities = require("html-entities");
var import_jsx_runtime2 = require("react/jsx-runtime");
es_default.registerLanguage("tla", function(hljs) {
return {
keywords: {
keyword: "ASSUME ASSUMPTION AXIOM BOOLEAN CASE CONSTANT CONSTANTS ELSE EXCEPT EXTENDS FALSE IF IN INSTANCE LET LOCAL MODULE OTHER STRING THEN THEOREM LEMMA PROPOSITION COROLLARY TRUE VARIABLE VARIABLES WITH CHOOSE ENABLED UNCHANGED SUBSET UNION DOMAIN BY OBVIOUS HAVE QED TAKE DEF HIDE RECURSIVE USE DEFINE PROOF WITNESS PICK DEFS PROVE SUFFICES NEW LAMBDA STATE ACTION TEMPORAL ONLY OMITTED "
},
contains: [
hljs.QUOTE_STRING_MODE,
hljs.COMMENT("\\(\\*", "\\*\\)"),
hljs.COMMENT("\\\\\\*", "$"),
hljs.C_NUMBER_MODE,
{ begin: /\/\\/ }
// relevance booster
]
};
});
var Listing = ({ node }) => {
const document2 = node.getDocument();
const attrs = node.getAttributes();
Expand Down
2 changes: 1 addition & 1 deletion components/dist/index.js.map

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions components/src/AsciiDoc/Listing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,28 @@ import cn from 'classnames'
import hljs from 'highlight.js'
import { decode } from 'html-entities'

// Custom highlight.js language definition to support TLA+
// Reference: https://github.com/highlightjs/highlight.js/pull/1658
hljs.registerLanguage('tla', function (hljs) {
return {
keywords: {
keyword:
'ASSUME ASSUMPTION AXIOM BOOLEAN CASE CONSTANT CONSTANTS ELSE EXCEPT EXTENDS FALSE ' +
'IF IN INSTANCE LET LOCAL MODULE OTHER STRING THEN THEOREM LEMMA PROPOSITION COROLLARY ' +
'TRUE VARIABLE VARIABLES WITH CHOOSE ENABLED UNCHANGED SUBSET UNION DOMAIN BY OBVIOUS ' +
'HAVE QED TAKE DEF HIDE RECURSIVE USE DEFINE PROOF WITNESS PICK DEFS PROVE SUFFICES ' +
'NEW LAMBDA STATE ACTION TEMPORAL ONLY OMITTED ',
},
contains: [
hljs.QUOTE_STRING_MODE,
hljs.COMMENT('\\(\\*', '\\*\\)'),
hljs.COMMENT('\\\\\\*', '$'),
hljs.C_NUMBER_MODE,
{ begin: /\/\\/ }, // relevance booster
],
}
})

const Listing = ({ node }: { node: AdocTypes.Block }) => {
const document = node.getDocument()
const attrs = node.getAttributes()
Expand Down