nozer/quill-delta-to-html

Encode special characters in Links

Opened this issue · 0 comments

We have a use case in our application, where we convert a Quill delta to HTML and later convert this generated HTML to PDF.
But the library we are using for this conversion currently has problems with the HTML generated by qull-delta-to-html.

According to the HTML specification, it is recommended to encode special characters to prevent ambiguity (see https://stackoverflow.com/a/16455004). Browsers seem to be tolerant in cases where no encoding is done, but other software like this converter in our case might not be.

For example a link like https://example.com?a="b"&x=y should be encoded as https://example.com?a="b"&x=y when serialized as a HTML attribute. In our cases, we only had to escape & as & and " as ", but I don't know if there are other characters that should be considered.