html_character_entities 0.0.3

html_character_entities #

A Dart utility class containing a map of key/value pairs for every HTML 4.01 character entity, including ASCII codes, and a method to parse strings for those character entities.

Using #

import 'package:html_character_entities/html_character_entities.dart';

Parsing Strings #

String string = 'An ampersand can be written as & and &.';

print(HtmlCharacterEntities.parse(string)); // An ampersand can be written as & and &.

Map #

final Map<String, String> c = HtmlCharacterEntities.characters;

String string = 'There are 4 suites of cards: ${c['&spades;']} Spades, ${c['&clubs;']} Clubs, ${c['&hearts;']} Hearts, ${c['&diams;']} Diamonds';

print(string); // There are 4 suites of cards: ♠ Spades, ♣ Clubs, ♥ Hearts, ♦ Diamonds

[0.0.3] - July 7, 2019

  • Changed RegExpMatch type declarations to Match

[0.0.2] - July 7, 2019

  • Commented the HtmlCharacterEntities class

[0.0.1] - July 7, 2019

  • Initial release

Use this package as a library

1. Depend on it

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

  html_character_entities: ^0.0.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter 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_character_entities/html_character_entities.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:html_character_entities/html_character_entities.dart.

Health suggestions

Format lib/html_character_entities.dart.

Run dartfmt to format lib/html_character_entities.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and html_character_entities.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.6.5