-
Notifications
You must be signed in to change notification settings - Fork 846
Remove HTML tags in the description column of video sitemaps #13236
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
Conversation
|
Caution: This PR has changes that must be merged to WordPress.com |
This is an automated check which relies on |
|
The spec says that both title and description can contain HTML. The spec also says that any HTML must be be HTML-escaped or wrapped in CDATA blocks. If you view the source of the video-sitemap-1.xml, you'll see that the description element correctly escapes all HTML as the spec requires. So the sitemap is being generated correctly. In one sense, that's all that really matters :) Since the sitemap is meant to be read by a machine and not a human, it doesn't really matter what it looks like to a human. But, Jetpack's sitemaps include an XSL Stylesheet to make the sitemap look pretty if a human does come along to view it. That's where the reported bug comes from: that humans see encoded HTML, which doesn't look pretty. I see three potential fixes:
diff --git a/modules/sitemaps/sitemap-stylist.php b/modules/sitemaps/sitemap-stylist.php
index ce883d7f1..08d38b0a9 100644
--- a/modules/sitemaps/sitemap-stylist.php
+++ b/modules/sitemaps/sitemap-stylist.php
@@ -549,3 +549,3 @@ $css
<td>
- <xsl:value-of select='video:video/video:description'/>
+ <xsl:value-of select='video:video/video:description' disable-output-escaping="yes"/>
</td>Thoughts? (Note that, for the title, although HTML is allowed, WordPress strips all tags during |
|
@mdawaffe Thanks a lot for the thorough review.
Definitely, this makes sense. I did not double check the official guide about this.
This makes the most sense for me. I will test and add another commit for this. |
|
Close this PR in favor of this #13261 |
Fixes #9546
Changes proposed in this Pull Request:
Testing instructions:
<strong>Description</strong> with <a href="https://github.com/Automattic/jetpack/issues/9546">HTML tags</a>.Description with HTML tags.Proposed changelog entry for your changes: