Fixed issue which makes a dartanalyzer warning

Closes issue #12
2 files changed
tree: f91e31708027360438a5304cb87e9ad1480cc38a
  1. .gitignore
  2. AUTHORS
  3. LICENSE
  4. README.md
  5. lib/
  6. pubspec.yaml
  7. test/
README.md

dartdoc markdown library

This is a standalone version of the dartdoc markdown library. It parses markdown and converts it to HTML.

You can see a demo running in the browser here (tested in Chrome and Dartium). The client library currently only supports HTML syntax highlighting do to some dart:io dependencies in libcss and analyzer_experimental.

Installation

Add this to your pubspec.yaml (or create it):

dependencies:
  markdown: any

Then run the Pub Package Manager (comes with the Dart SDK):

pub install

Usage

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

main() {
  print(markdownToHtml('Hello *Markdown*'));
}

Version 0.4 adds support for GitHub style triple backtick code blocks, with built in Dart syntax coloring. Custom classifiers can be added using a syntax list:

import 'package:markdown/markdown.dart';

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