Giter VIP home page Giter VIP logo

lang-markdown's Introduction

@codemirror/lang-markdown NPM version

[ WEBSITE | ISSUES | FORUM | CHANGELOG ]

This package implements Markdown language support for the CodeMirror code editor.

The project page has more information, a number of examples and the documentation.

This code is released under an MIT license.

We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.

API Reference

markdown(config⁠?: Object = {}) → LanguageSupport

Markdown language support.

config
defaultCodeLanguage⁠?: Language

When given, this language will be used by default to parse code blocks.

codeLanguages⁠?: readonly LanguageDescription[]

A collection of language descriptions to search through for a matching language (with LanguageDescription.matchLanguageName) when a fenced code block has an info string.

addKeymap⁠?: boolean

Set this to false to disable installation of the Markdown keymap.

markdownLanguage: Language

Language support for Markdown/CommonMark.

insertNewlineContinueMarkup: StateCommand

This command, when invoked in Markdown context with cursor selection(s), will create a new line with the markup for blockquotes and lists that were active on the old line. If the cursor was directly after the end of the markup for the old line, trailing whitespace and list markers are removed from that line.

The command does nothing in non-Markdown context, so it should not be used as the only binding for Enter (even in a Markdown document, HTML and code regions might use a different language).

deleteMarkupBackward: StateCommand

This command will, when invoked in a Markdown context with the cursor directly after list or blockquote markup, delete one level of markup. When the markup is for a list, it will be replaced by spaces on the first invocation (a further invocation will delete the spaces), to make it easy to continue a list.

When not after Markdown block markup, this command will return false, so it is intended to be bound alongside other deletion commands, with a higher precedence than the more generic commands.

markdownKeymap: readonly KeyBinding[]

A small keymap with Markdown-specific bindings. Binds Enter to insertNewlineContinueMarkup and Backspace to deleteMarkupBackward.

lang-markdown's People

Contributors

marijnh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.