How to configure custom brackets for markdown

I wanna autoclosing for such signs as ‘`’ or ‘*’ or ‘_’, not only {(’". And I can’t figure out of the documentation where should I put the config object {brackets:["(", "[", '{', "'", '"', '```', '*','_',]}. Where and how the hack should I put it? I have no idea how can I change languageData.

Here is my current config.

const startState = EditorState.create({
    doc: page.text,
    extensions: [
        keymap.of([...defaultKeymap, ...historyKeymap, ...closeBracketsKeymap, ...markdownKeymap, indentWithTab]),
        history(),
        closeBrackets(),
        indentOnInput(),
        bracketMatching(),
        defaultHighlightStyle.fallback,
        markdown({
            base: markdownLanguage,
            codeLanguages: languages,
            addKeymap: true,
        }),
        placeholder('Mark dowm something juicy 🍋'),
        bollsPadTheme,
        syntaxHighlighting,
        EditorView.lineWrapping,
        EditorView.updateListener.of(do(update)
            if update.changes
                handleChange && handleChange(update.state)
        )
    ]
})

editorView = new EditorView({
    state: startState,
    parent: self
})

Thanks.

Add markdownLanguage.data.of({closeBrackets: {brackets: ...}}) to your configuration.

1 Like

Thank you! I spend hours looking for the solution!