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

Fix ]]> escaping in CDATA sections #174

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

Turbo87
Copy link
Contributor

@Turbo87 Turbo87 commented Nov 17, 2024

This PR resolves #173 by splitting CDATA sections by the ]]> search string and adding multiple BytesCData events, if necessary.

As mentioned in the linked issue, I've also reported this bug at quick-xml to clarify who's responsibility the escaping is. If the responsibility is on the caller then this PR should fix the issue.

I ran cargo bench a couple of times on master and this branch and it seems like the performance impact is negligible.

Related:

@Turbo87
Copy link
Contributor Author

Turbo87 commented Nov 17, 2024

tafia/quick-xml#832 should fix the issue on the quick-xml side, but it will still require changes to the rss crate due to the newly introduced BytesCData::escaped() fn that will need to be used instead of BytesCData::new(). once a version of quick-xml with the fix is available I'll adjust this PR to use that instead.

@Turbo87
Copy link
Contributor Author

Turbo87 commented Nov 17, 2024

once a version of quick-xml with the fix is available I'll adjust this PR to use that instead.

done! :)

@Turbo87
Copy link
Contributor Author

Turbo87 commented Nov 20, 2024

/cc @andy128k in case you hadn't seen this yet :)

@andy128k andy128k merged commit bc38dfb into rust-syndication:master Nov 20, 2024
12 checks passed
@Turbo87 Turbo87 deleted the cdata-escape branch November 20, 2024 13:10
@andy128k
Copy link
Member

@Turbo87 The change is released in 2.0.11

@Turbo87
Copy link
Contributor Author

Turbo87 commented Nov 22, 2024

awesome, thank you!

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.

]]> in CDATA is not escaped
2 participants