html_unescape 0.1.0

html_unescape #

A Dart library for unescaping HTML-encoded strings.

Supports:

  • Named Character References ( )
  • Decimal Character Reference (á)
  • Hexadecimal Character Reference (ã)

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 ⤒.

Changelog #

0.0.1 #

  • Initial version

example/example.dart

// Copyright (c) 2016, <your name>. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:html_unescape/html_unescape.dart';

main() {
  var unescape = new HtmlUnescape();
  print(unescape.convert("&lt;strong&#62;This &quot;escaped&quot; string "
      "will be printed normally.</strong>"));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  html_unescape: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:html_unescape/html_unescape.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
97
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
49
Learn more about scoring.

This package version is not analyzed, because it is more than two years old. Check the latest stable version for its analysis.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0