पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv2.0.0

html_unescape

HTML को अन-एस्केप करने के लिए एक छोटी पुस्तकालय। सभी नामित चरित्र संदर्भ, दशमलव चरित्र संदर्भ और हेक्साडेसिमल चरित्र संदर्भ का समर्थन करता है।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
4.6 लाख
लाइक
181
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add html_unescape

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक हल्का फ्लटर/डार्ट पैकेज जो HTML एंटिटीज को डीकोड करता है, शामिल है नामित, दशमलव और हेक्साडेसिमल चरित्र संदर्भ। यह सुरक्षित रूप से एस्केप्ड HTML टेक्स्ट को मूल रूप में बदलता है, जिससे वेब स्रोतों या उपयोगकर्ता इनपुट से कंटेंट को रेंडर करने के लिए आदर्श है। लाइब्रेरी कार्यक्षम, न्यूनतम है और बहुत से प्लेटफॉर्मों पर डार्ट एप्लिकेशन में उपयोग के लिए डिज़ाइन की गई है।

उपयोग

  • UI में HTML-एन्कोडेड पाठ का निरूपण
  • उपयोगकर्ता-उत्पादित सामग्री का प्रसंस्करण
  • वेब एपीआई से डेटा पार्स करना
  • CMS से प्रारूपित पाठ प्रदर्शित करना
  • प्रदर्शन से पहले इनपुट को सैनिटाइज़ करना

मुख्य विशेषताएँ

  • सभी HTML एंटिटी प्रकारों का समर्थन करता है
  • हल्का और तेज़
  • क्रॉस-प्लेटफॉर्म संगतता
  • सरल API, स्पष्ट विधियाँ
  • कोई बाहरी निर्भरता नहीं

इनके लिए उपयुक्त

  • कच्चे HTML स्ट्रिंग का निर्माण करने वाले ऐप्स
  • सामग्री रेंडरिंग एप्लिकेशन
  • वेब स्क्रैपिंग उपकरण
  • पाठ प्रक्रिया उपकरण
  • शैक्षिक या संदर्भ ऐप

विचार योग्य बातें

  • पूर्ण HTML दस्तावेज़ का विश्लेषण नहीं करता है
  • XSS सुरक्षा के लिए उपयुक्त नहीं
  • अनएस्केप्ड कंटेंट के हैंडलिंग की आवश्यकता होती है
  • चरित्र संदर्भ डीकोडिंग तक सीमित
  • जटिल HTML संशोधन के लिए नहीं बनाया गया है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

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.

श्रेणियाँ

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

रैंकिंग