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

chop filter glitches when allowed HTML tags have attributes #15

Open
michaelrog opened this issue Apr 3, 2019 · 0 comments
Open

chop filter glitches when allowed HTML tags have attributes #15

michaelrog opened this issue Apr 3, 2019 · 0 comments

Comments

@michaelrog
Copy link
Member

The chop filter appears to have issues when allowed HTML tags have attributes, such as the a tag with title attribute in this example.

Source HTML:

<h2>Do you have what it takes to join our firm?</h2>
<p>We are <a href="http://localhost:8000/about-us#entry:15350:url">looking for students</a> who exhibit the skillsets and ambition to deliver <strong><a href="/about/our-ten-imperatives-of-client-service" title="Our Ten Imperatives of Client Service">The Ten Imperatives of Client Service</a>.</strong></p>

Craft Template Code:

{{ career.basicPageContent|chop(limit=30, unit='w', allowedTags="<em> <p> <h2> <a> <strong>", append="...") }} 

Resulting HTML:

<h2>Do you have what it takes to join our firm?</h2>
<p>We are <a href="http://localhost:8000/about-us#entry:15350:url">looking for students</a> who exhibit the skillsets and ambition to deliver <strong><a href="/about/our-ten-imperatives-of...</a></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant