Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
andrebraga opened this issue Nov 27, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@andrebraga
Copy link

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.

@RandomHashTags RandomHashTags added the bug Something isn't working label Nov 27, 2024
@RandomHashTags RandomHashTags self-assigned this Nov 27, 2024
@RandomHashTags
Copy link
Owner

Can confirm the problem. Working on a fix ASAP!

@RandomHashTags
Copy link
Owner

Fixed in latest commit. 0.10.1 update expected this Friday (or this weekend). Thanks for reporting! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants