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

Tell people not to use the markdown filter on page or section content #989

Closed
TeFiLeDo opened this issue Apr 11, 2020 · 3 comments
Closed
Labels
done in pr Already done in a PR

Comments

@TeFiLeDo
Copy link

Documentation issue

Summary

On the Templates/Overview page, the documentation mentions a markdown filter, that turns markdown content into HTML. On the Templates/Sections and Pages page, it also explains that both pages and sections get a content variable.

However, as far as I know, it isn't mentioned anywhere, that the content variable already contains HTML. This lead me to use the filter in my template and write {{ page.content | markdown | safe }} instead of {{ page.content | safe }}.

While this might not seem like a problem (since markdown can contain HTML), it causes a problem in code block, where any indentation is removed after an empty line. There might also be other problems I didn't notice.

Proposed solution

Either tell users that the content variable contains HTML on the Templates/Sections and Pages page or tell them to not use the markdown filter on the content variable on the Templates/Overview page.

I personally think the first one is the better solution because otherwise, this would feel like a special case for the content variable, while it actually affects every HTML input.

@Keats
Copy link
Collaborator

Keats commented Apr 12, 2020

Good point!

@Keats
Copy link
Collaborator

Keats commented Apr 12, 2020

I've updated the docs in the next branch.

@TeFiLeDo
Copy link
Author

Thank you very much!

@Keats Keats added the done in pr Already done in a PR label Apr 12, 2020
@Keats Keats closed this as completed in 469babb May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

2 participants