Skip to content

Over-escaping tag-specific attributes when outputting Data or ByteBuffer #3

Closed
@andrebraga

Description

@andrebraga

Manifests as

<!DOCTYPE html><html><head><meta charset=\"utf-8\">[...]</html>

and similarly with src=\", rel=\", class=\"... on script, link, div (etc) tags.

I've pinpointed the reason to

attributes_func += #"if let \#(key) { items.append("\#(key_literal)=\\\"" + \#(value) + "\\\"") }"#

and elsewhere triple-backslash was used in the expansion, but this is causing extra backslashes to be added to Data and ByteBuffer outputs (easily seen on full macro expansions, decimal 92 in the byte sequence). I understand this was added to correctly escape String outputs, where the compiler will take care of the unescaping, but perhaps this is better served by #""# or some other type of special handling for Data and ByteBuffer.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions