marked 0.2.1 copy "marked: ^0.2.1" to clipboard
marked: ^0.2.1 copied to clipboard

outdated

A simple Markdown parser for Dart. Create your own custom Markdown syntax.

example/main.dart

import 'package:marked/marked.dart';

final markdown = Markdown.map({
  '**': (text, match) => '<b>$text</b>',
  '*': (text, match) => '<i>$text</i>',
  '***': (text, match) => '<i>$text</i>',
  '__': (text, match) => '<u>$text</u>',
  '<custom>': (text, match) => '<tag>$text</tag>',
}, placeholders: {
  MarkdownPlaceholder.enclosed(
      'from here', end: 'to here', (text, match) => '[$text]'),
});

void main() {
  print(markdown.apply('''
      Hello **World**!
      __Looks *pretty* easy__ 
      <custom>Custom tags</custom>
      from here ... do anything ... to here
    '''));

  // Output:
  //   Hello <b>World</b>!
  //   <u>Looks <i>pretty</i> easy</u>
  //   <tag>Custom tags</tag>
  //   [ ... do anything ... ]
}
5
likes
0
pub points
48%
popularity

Publisher

verified publisherdrafakiller.com

A simple Markdown parser for Dart. Create your own custom Markdown syntax.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on marked