Skip to content

Proper escaping for string literals#1360

Open
netfri25 wants to merge 5 commits into
elkowar:masterfrom
netfri25:master
Open

Proper escaping for string literals#1360
netfri25 wants to merge 5 commits into
elkowar:masterfrom
netfri25:master

Conversation

@netfri25

@netfri25 netfri25 commented Jul 23, 2025

Copy link
Copy Markdown

Description

Applies unescaping for string literals in the lexer.
No things have been added to implement this, since it makes use of the unescape crate that was used in a different place.

Usage

"next line\ntabbed\tspace using hex code\x20"

Checklist

  • All widgets I've added are correctly documented.
  • I added my changes to CHANGELOG.md, if appropriate.
  • The documentation in the docs/content/main directory has been adjusted to reflect my changes.
  • I used cargo fmt to automatically format all code before committing

@netfri25

Copy link
Copy Markdown
Author

this is also a fix for #84, but more general (every string literal instead of just label text)

@w-lfchen w-lfchen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like this pr should include switching the escaping crate, see #1194.
i might pick that pr up at some point with an actual implementation but i've lost the energy, time and motivation to work on eww as of writing.
just thought i should point this out because it seemed relevant

@netfri25

Copy link
Copy Markdown
Author

this wasn't hard to implement, so I've just done it myself.
for now it doesn't really handle any errors, and when an error occures when escaping a string literal then it just returns the original unescaped string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants