Skip to content
pubscout

html2md

1.3.2, released 2 years ago by an unverified publisher

Converts HTML strings or DOM nodes to CommonMark‑compatible Markdown.

WASM-ready
$ flutter pub add html2md
Source repository

What it does

The package parses HTML and outputs Markdown according to configurable style options. It supports tables, custom conversion rules, and ignoring elements.

AI-written summary of version 1.3.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to render HTML content as Markdown in a Dart or Flutter app
  • You want configurable conversion (e.g., heading style, list markers)

Skip it when

  • You require full fidelity HTML rendering (images, complex layouts)
  • You need a streaming or incremental conversion API

Strengths

  • Simple API with a single convert function
  • Customizable via style options, ignore list, and custom rules

Weaknesses

  • Limited to basic HTML features; complex CSS or scripts are ignored
  • No streaming or async conversion support

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
import 'package:html2md/html2md.dart' as html2md;

void main(){
  var html = '<h1>Hello</h1>';
  var markdown = html2md.convert(html);
  print(markdown);
}

Alternatives

Packages that do the same job and could replace html2md.

  • markdown

    A portable Markdown library written in Dart that can parse Markdown into HTML.

  • markdown_description_list

    Adds support for Markdown description/definition lists to the markdown package

  • dart_markdown

    A portable Markdown library written in Dart that parses Markdown into AST and HTML.

  • barbecue

    Render text tables for CLI-based Dart applications with custom borders, padding, and ANSI colors.

Works with

Packages commonly used together with html2md: ones it builds on, ones built on it, and its own family.