marked 0.2.5 copy "marked: ^0.2.5" to clipboard
marked: ^0.2.5 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 ... ]
}
2
likes
140
pub points
17%
popularity

Publisher

verified publisherdrafakiller.com

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on marked