markd

A fork of David Peek's dart-markdown for easy customization of Markdown syntaxes.

Differences:

  1. LinkResolver replaces Resolver to provide more options.

  2. InlineSyntax introduces additional argument, caseSensitive.

  3. The header syntax requires a whitespace between # and the text, so #foo can represent a link (like Github does). For example, # foo is a header, while #foo is not.

Usage

You can find the installation directions here.

import 'package:markdown/markdown.dart' show markdownToHtml;

main() {
  print(markdownToHtml('Hello *Markdown*'));
  //=> <p>Hello <em>Markdown</em></p>
}

You can create and use your own syntaxes!

import 'package:markdown/markdown.dart';

main() {
  List<InlineSyntax> syntaxes = [new TextSyntax('nyan', sub: '~=[,,_,,]:3')];
  print(markdownToHtml('nyan', inlineSyntaxes: syntaxes));
  //=> <p>~=[,,_,,]:3</p>
}

You can find the documentation for this library here.

Libraries

markdown

Parses text in a markdown-like format and renders to HTML.