HtmlParser constructor

HtmlParser(
  1. BuildContext context, {
  2. required TextStyle textStyle,
})

Implementation

HtmlParser(this.context, {required this.textStyle}) {
  this._startTag = new RegExp(
      r'^<([-A-Za-z0-9_]+)((?:\s+[-\w]+(?:\s*=\s*(?:(?:"[^"]*")' +
          "|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>");
  this._endTag = new RegExp("^<\/([-A-Za-z0-9_]+)[^>]*>");
  this._attr = new RegExp(
      r'([-A-Za-z0-9_]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")' +
          r"|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?");
  this._style = new RegExp(r'([a-zA-Z\-]+)\s*:\s*([^;]*)');
  this._color = new RegExp(r'^#([a-fA-F0-9]{6})$');
}