html_unescape

A Dart library for unescaping HTML-encoded strings.

Supports:

  • Named Character References (&nbsp)
  • Decimal Character Reference (á)
  • Hexadecimal Character Reference (&#xE3)

Usage

A simple usage example:

import 'package:html_unescape/html_unescape.dart';

main() {
  var unescape = new HtmlUnescape();
  var text = unescape.convert("<strong>This "escaped" string");
  print(text);
}

If you're sure you will only encounter the most common escaped characters, you can import 'package:html_unescape/html_unescape_basic.dart' instead of the full version. This will decrease code size and increase performance. The only difference is in the size of the Named Character Reference dictionary. The full set includes the likes of ⥐ or ⤒.

Libraries

html5_unescape

Unescapes HTML5-escaped strings. This version doesn't support all runes to decrease code size and increase performance.

html_unescape

Unescapes HTML5-escaped strings.