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

Whitelist Footer Element #326

Closed
cjeller1592 opened this issue Jun 18, 2020 · 1 comment · Fixed by #329
Closed

Whitelist Footer Element #326

cjeller1592 opened this issue Jun 18, 2020 · 1 comment · Fixed by #329
Labels
enhancement Proposed enhancements to current behavior good first issue help wanted
Milestone

Comments

@cjeller1592
Copy link
Contributor

Describe the bug

If you publish a post with the footer HTML element, it's stripped from the post.

Context: I am trying to use a web extension's embed feature (Quotebacks) that's code requires the manipulation of the embed's footer. Since the footer gets stripped from the post, the code cannot find the footer and doesn't render properly.

Steps to reproduce (if necessary)

Steps to reproduce the behavior:

  1. Publish a post with a <footer></footer> element
  2. Inspect the post in browser tools
  3. Notice how the footer element in the post is gone

Expected behavior

The footer element should have stayed intact when you inspect the post.

@thebaer thebaer added enhancement Proposed enhancements to current behavior good first issue help wanted labels Jun 22, 2020
@thebaer
Copy link
Member

thebaer commented Jun 22, 2020

Thanks for reporting this! While we're at it, we might as well support the <header> element, too.

This should be a pretty straightforward fix -- simply add:

policy.AllowElements("header", "footer")

in this func:

https://github.com/writeas/writefreely/blob/5c94d23466dc3e7e1821b845d9d7db9294c48af4/postrender.go#L171-L184

@thebaer thebaer added this to the 0.13 milestone May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Proposed enhancements to current behavior good first issue help wanted
Development

Successfully merging a pull request may close this issue.

2 participants