Skip to content

Fix double backslash issue#61

Merged
iwahbe merged 2 commits intoiwahbe:mainfrom
zellerin:double-escape-patch
May 7, 2025
Merged

Fix double backslash issue#61
iwahbe merged 2 commits intoiwahbe:mainfrom
zellerin:double-escape-patch

Conversation

@zellerin
Copy link
Contributor

@zellerin zellerin commented May 6, 2025

Hi,

the string edit does not treat properly double \ sequence, in particular when followed by " or \n.

Example json:

{"A\\nsecond\\nline"}

The jsonian-edit-string gives

A\
second\
line

Expected is:

A\nsecond\nline

The string edit did not treat properly \\ sequence, especially when followed by " or \n.

Example json:

```
{"A\\nsecond\\nline"}
```

The jsonian-edit-string did give
```
A\
second\
line
```

Now it gives
```
A\nsecond\nline
```
@iwahbe
Copy link
Owner

iwahbe commented May 6, 2025

Hi @zellerin. Thanks for pointing this out! Would you be willing to add a quick test to jsonian-tests.el for this?

@iwahbe
Copy link
Owner

iwahbe commented May 7, 2025

Thanks!

@iwahbe iwahbe merged commit 513219e into iwahbe:main May 7, 2025
2 checks passed
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