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

Add missing title XML escapes for video sitemap element #130

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

jarylc
Copy link
Contributor

@jarylc jarylc commented Apr 18, 2024

I've noticed my sitemap failing when I have special characters in the title and have a video element in the sitemap.

It's caused by forgetting to escape the title as I used the title as is for the video title.

Ref: https://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documents

@@ -166,6 +166,16 @@ export class SitemapResponseBuilder extends ResponseBuilder {
return 'text/xml';
}

_escapeXML(str) {
Copy link
Member

@wenbinf wenbinf Apr 18, 2024

Choose a reason for hiding this comment

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

We already have a similar function escapeHtml() at common-src/StringUtils.js -

export function escapeHtml(htmlStr) {

could you please use escapeHtml() instead of creating a duplicate function?

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right missed that, rectified.

@wenbinf wenbinf merged commit 170ad3a into microfeed:main Apr 19, 2024
1 check 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.

None yet

2 participants