Buscar pacotes, repositórios e categorias de apps

Repositório GitHubfiliph/html_unescape

html_unescape

Biblioteca Dart para desescapar strings codificadas em HTML

Capa do projeto html_unescape
Estrelas
41
Forks
9
Último push (UTC)
22 de mar. de 2021
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

html_unescape

Build Status

A Dart library for unescaping HTML-encoded strings.

Supports:

  • Named Character References ( )
    • 2099 of them
  • Decimal Character References (á)
  • Hexadecimal Character References (ã)

The idea is that while you seldom need encoding to such a level (most of the time, all you need to escape is <, >, /, & and "), you do want to make sure that you cover the whole spectrum when decoding from HTML-escaped strings.

Inspired by Java's unbescape library.

Usage

A simple usage example:

import 'package:html_unescape/html_unescape.dart';

main() {
  var unescape = HtmlUnescape();
  var text = unescape.convert("&lt;strong&#62;This &quot;escaped&quot; string");
  print(text);
}

You can also use the converter to transform a stream. For example, the code below will transform a POSIX stdin into an HTML-unencoded stdout.

await stdin
    .transform(Utf8Decoder())
    .transform(HtmlUnescape())
    .transform(Utf8Encoder())
    .pipe(stdout);

Full versus small

If you're sure you will only encounter the most common escaped characters, you can import 'package:html_unescape/html_unescape_small.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 &DownLeftRightVector; or &UpArrowBar; while the small set only includes the first 255 charcodes.

Issues

Please use GitHub tracker. Don't hesitate to create pull requests, too.

Filip Hracek GitHub avatar
Autor no GitHub

Filip Hracek ↗

Builds games and silly software experiments in @flutter, @dart-lang and sometimes other technologies.

RaindeadPrague, CzechiaSite oficial ↗
LinguagensDart

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 4 itens

  • metaDesenvolvimento^1.3.0
  • pathDesenvolvimento^1.8.0
  • pedanticDesenvolvimento^1.11.0
  • testDesenvolvimento^1.16.8

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗