Skip to content

fix(v1): stop escaping / in ensure_v1#155

Open
jakobhellermann wants to merge 1 commit into
kdl-org:mainfrom
jakobhellermann:fix-escape-slash-v1
Open

fix(v1): stop escaping / in ensure_v1#155
jakobhellermann wants to merge 1 commit into
kdl-org:mainfrom
jakobhellermann:fix-escape-slash-v1

Conversation

@jakobhellermann
Copy link
Copy Markdown

KdlEntry::ensure_v1 was replacing every / in non-raw v1 string literals with \/. While that's allowed in v1 (not in v2), it is not necessary.

ensure_v2 strips \/, as expected.

Comment thread src/document.rs
}
filepicker location="zellij:strider" {
cwd "\/"
cwd "/"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The test asserts

v1_to_v2(v1) == v2
v2_to_v1(v2) == v1

This is incompatible with both

  • / (v1) -> / (v2)
  • \/ (v1) -> / (v2)

So I changed this to be a /. The new tests assert that v1->v2 unescapes the forward slash.

`KdlEntry::ensure_v1` was replacing every `/` in non-raw v1 string literals with `\/`.
While that's allowed in v1 (not in v2), it is not necessary.

`ensure_v2` strips `\/`, as expected.
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.

1 participant