jaspr_markdown library
A Markdown renderer for Jaspr. It lets you use Jaspr components in Markdown. You can import components like MDX.
Classes
- AlertBlockSyntax
- Parses GitHub Alerts blocks.
- AutolinkExtensionSyntax
-
Matches autolinks like
http://foo.comandfoo@bar.com. - AutolinkSyntax
-
Matches autolinks like
<http://foo.com>. - BlockParser
- Maintains the internal state needed to parse a series of lines into blocks of Markdown suitable for further inline parsing.
- BlockquoteSyntax
-
Parses email-style blockquotes:
> quote. - BlockSyntax
- CodeBlockSyntax
- Parses preformatted code blocks that are indented four spaces.
- CodeSyntax
- Matches backtick-enclosed inline code blocks.
- ColorSwatchSyntax
- Matches code blocks containing a subset of CSS color syntax.
- ComponentBlockSyntax
- Parses Jaspr components.
- DecodeHtmlSyntax
-
Decodes numeric character references, for example decode
#to#. - Delimiter
- A delimiter indicating the possible "open" or possible "close" of a tag for a DelimiterSyntax.
- DelimiterRun
- An implementation of Delimiter which uses concepts of "left-flanking" and "right-flanking" to determine the values of canOpen and canClose.
- DelimiterSyntax
-
Matches syntax that has a pair of tags and becomes an element, like
*for<em>. Allows nested tags. - DelimiterTag
- Document
- Maintains the context needed to parse a Markdown document.
- DummyBlockSyntax
- Walks the parser forward through the lines does not match any BlockSyntax.
- Element
- A named tag that can contain other nodes.
- EmailAutolinkSyntax
-
Matches autolinks like
<foo@bar.example.com>. - EmojiSyntax
-
Matches GitHub Markdown emoji syntax like
:smile:. - EmphasisSyntax
- EmptyBlockSyntax
- EscapeHtmlSyntax
-
Encodes (
"), (<), (>) and (&). - EscapeSyntax
- Escape ASCII punctuation preceded by a backslash.
- ExtensionSet
- ExtensionSets provide a simple grouping mechanism for common Markdown flavors.
- FencedBlockquoteSyntax
-
Parses lines fenced by
>>>to blockquotes - FencedCodeBlockSyntax
- Parses preformatted code blocks between two ~~~ or ``` sequences.
- FootnoteDefSyntax
- The spec of GFM about footnotes is missing. For online source code of cmark-gfm, see master@c32ef78. A Rust implementation is also available. Footnote definition could contain multiple line-children and children could be separated by one empty line. Its first child-line would be the remaining part of the first line after taking definition leading, combining with other child lines parsed by parseChildLines, is fed into BlockParser.
- HeaderSyntax
-
Parses atx-style headers:
## Header ##. - HeaderWithIdSyntax
- Parses atx-style headers, and adds generated IDs to the generated elements.
- HorizontalRuleSyntax
-
Parses horizontal rules like
---,_ _ _,* * *, etc. - HtmlBlockSyntax
- Parse HTML blocks.
- HtmlRenderer
- Translates a parsed AST to HTML.
- ImageSyntax
-
Matches images like
and![alternate text][label]. - InlineHtmlSyntax
- Leave inline HTML tags alone, from CommonMark 0.30.
- InlineLink
- InlineParser
- Maintains the internal state needed to parse inline span elements in Markdown.
- InlineSyntax
- Represents one kind of Markdown tag that can be parsed.
- Line
-
A Line is a sequence of zero or more characters other than line feed
(
U+000A) or carriage return (U+000D), followed by a line ending or by the end of file. - LineBreakSyntax
- Represents a hard line break.
- LinkContext
-
A helper class holds params of link context.
Footnote creation needs other info in
_tryCreateReferenceLink. - LinkReference
- A link reference definition.
- LinkReferenceDefinitionSyntax
- LinkSyntax
-
Matches links like
[blah][label]and[blah](url). - ListItem
- ListSyntax
- Base class for both ordered and unordered lists.
- Markdown
- Represents a Markdown document.
- Node
- Base class for any AST item.
- NodeVisitor
- Visitor pattern for the AST.
- OrderedListSyntax
- Parses ordered lists.
- OrderedListWithCheckboxSyntax
- Parses ordered lists with checkboxes.
- ParagraphSyntax
- Parses paragraphs of regular text.
- SetextHeaderSyntax
- Parses setext-style headers.
- SetextHeaderWithIdSyntax
- Parses setext-style headers, and adds generated IDs to the generated elements.
- SimpleDelimiter
- A simple delimiter implements the Delimiter interface with basic fields, and does not have the concept of "left-flanking" or "right-flanking".
- SoftLineBreakSyntax
- Removes the single space before the line ending.
- StrikethroughSyntax
- Matches strikethrough syntax according to the GFM spec.
- TableSyntax
- Parses tables.
- Text
- A plain text element.
- TextSyntax
- Matches stuff that should just be passed through as straight text.
- UnorderedListSyntax
- Parses unordered lists.
- UnorderedListWithCheckboxSyntax
- Parses unordered lists with checkboxes.
- UnparsedContent
- Inline content that has not been parsed into inline nodes (strong, links, etc).
Enums
Functions
-
markdownToHtml(
String markdown, {Iterable< BlockSyntax> blockSyntaxes = const [], Iterable<InlineSyntax> inlineSyntaxes = const [], ExtensionSet? extensionSet, Resolver? linkResolver, Resolver? imageLinkResolver, bool inlineOnly = false, bool encodeHtml = true, bool enableTagfilter = false, bool withDefaultBlockSyntaxes = true, bool withDefaultInlineSyntaxes = true}) → String - Converts the given string of Markdown to HTML.
-
renderToHtml(
List< Node> nodes, {bool enableTagfilter = false}) → String -
Renders
nodesto HTML.