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

#1621 fix: correct escaping of backslashes in URL wrapping #1622

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: add snapshot and test case for URL escaping with backslashes (#…
ruchira-net committed Nov 26, 2024
commit e027815f01d479ee376b408282cbaaf96c22bd49
2 changes: 2 additions & 0 deletions test/runtime/__snapshots__/getUrl.test.js.snap
Original file line number Diff line number Diff line change
@@ -85,3 +85,5 @@ exports[`escape should escape url 41`] = `""image other.png#hash""`;
exports[`escape should escape url 42`] = `""image other.png#hash""`;

exports[`escape should escape url 43`] = `""image other.png#hash""`;

exports[`escape should escape url 44`] = `"http://url/path\\/"`;
1 change: 1 addition & 0 deletions test/runtime/getUrl.test.js
Original file line number Diff line number Diff line change
@@ -127,5 +127,6 @@ describe("escape", () => {
{ hash: "#hash", needQuotes: true },
),
).toMatchSnapshot();
expect(getUrl("http://url/path\\/")).toMatchSnapshot();
Copy link
Member

Choose a reason for hiding this comment

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

Can you provide a real example of the problem? Using url()?

Copy link
Author

Choose a reason for hiding this comment

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

@alexander-akait I've added a more real URL example. Hope that's good enough. Thanks!

});
});