Skip to content

Double quotes (") are not escaped #39

@deengel

Description

@deengel

As far as I understand, double quotes (") should be escaped with " in the generated HTML.
<, > and & are correctly escaped.

import 'package:highlight/highlight.dart' show highlight;

main() {
  var source = '''main() {
  print("Hello <> World!");
}
''';

  var result = highlight.parse(source, language: 'dart');
  var html = result.toHtml();
  print(html); // HTML string
}

Actual output is:

<span class="hljs-built_in">print</span>(<span class="hljs-string">"Hello &lt;&gt; World!"</span>);

Expected output is:

<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Hello &lt;&gt; World!&quot;</span>);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions