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

RSS feed has <p> tags inside <description> #1

Closed
sauerbraten opened this issue Oct 20, 2020 · 3 comments
Closed

RSS feed has <p> tags inside <description> #1

sauerbraten opened this issue Oct 20, 2020 · 3 comments

Comments

@sauerbraten
Copy link

sauerbraten commented Oct 20, 2020

According to https://stackoverflow.com/questions/7203450/what-paragraphs-and-line-breaks-are-valid-rss-formatting#comment8810661_7203450 (and other sources on the internet), <p> tags inside <description> violate the RSS spec.

Blades seems to automatically wrap the summary of a page in these tags, since I get them in my normal template as well. Why? How about making it so {{summary}} doesn't automatically get wrapped and relying on the user to make sure they are marked up correctly, and the feed will be valid as well?

@grego
Copy link
Owner

grego commented Oct 20, 2020

The summary field had markdown support enabled and by default, pulldown_cmark puts text inside <p> tags.
Before Ramhorns 1.0 is released, the only way to avoid this is either to specifically implement the Content trait for a custom type, or to remove the markdown support for this field altogether.
I've opted for the latter in the commit a220b84.
Edit: commit number.

@sauerbraten
Copy link
Author

I'm a complete Rust noob but dove into the code of ramhorns and pulldown_cmark and got to the conclusion that this would require a custom cmark parser in ramhorns that filters Tags that indicate block-level Elements (and errors when one is found). But now I see ramhorns wants to implement Markdown support entirely differently?

Thanks for the fast reaction and fix, anyway! (By the way, you linked the wrong commit: a220b84)

@grego
Copy link
Owner

grego commented Oct 20, 2020

Thank you, fixed the commit number.

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

No branches or pull requests

2 participants