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

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 ... ]
}
3
likes
0
pub points
24%
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