搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫filiph/html_unescape

html_unescape

用於解碼 HTML 編碼字串的 Dart 庫

html_unescape 專案封面
星標
41
分支
9
最近推送(UTC)
2021年3月22日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

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
GitHub 作者

Filip Hracek ↗

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

RaindeadPrague, Czechia官方網站 ↗
語言Dart

此儲存庫發佈的套件

使用的依賴

依賴清單 4 項

  • meta開發依賴^1.3.0
  • path開發依賴^1.8.0
  • pedantic開發依賴^1.11.0
  • test開發依賴^1.16.8

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

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

GitHub Docs — About repositories ↗