Skip to content

Commit d1283db

Browse files
onovyredimp
authored andcommitted
fix: enable GFM in markdown editor (task lists, strikethrough, tables)
Use markdownLanguage as base for markdown() to enable GitHub Flavored Markdown extensions. Without this, [x] was parsed as a link instead of a TaskMarker, causing checklist items to appear in link color rather than the correct atom color.
1 parent 6e8419a commit d1283db

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

cm6-src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
bracketMatching,
1717
defaultHighlightStyle,
1818
} from '@codemirror/language';
19-
import { markdown, insertNewlineContinueMarkup } from '@codemirror/lang-markdown';
19+
import { markdown, markdownLanguage, insertNewlineContinueMarkup } from '@codemirror/lang-markdown';
2020
import { search, searchKeymap, openSearchPanel } from '@codemirror/search';
2121
import { closeBrackets, closeBracketsKeymap } from '@codemirror/autocomplete';
2222

@@ -73,7 +73,7 @@ function initEditor() {
7373
indentOnInput(),
7474
bracketMatching(),
7575
closeBrackets(),
76-
markdown({ codeLanguages }),
76+
markdown({ codeLanguages, base: markdownLanguage }),
7777
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
7878
themeCompartment.of(isDarkMode ? darkTheme : lightTheme),
7979
inlineCodeHighlighter,

0 commit comments

Comments
 (0)