Skip to content

Not valid striptags result, if summary is sliced #2

@if1live

Description

@if1live

bug description

  1. if summary text is...
blah...blah...blah....<a href="http://pythonhosted.org/openpyxl/">openpyxl</a>

I assume length of sample text is 220.

  1. apply article.summary[:200]
blah...blah...blah....<a href="http://pythonhosted.org/ope
  1. apply striptags
blah...blah...blah....<a href="http://pythonhosted.org/ope

FAILED

How to fix?

apply striptags to full content, then slice.

- article.summary[:200]|striptags 
+ article.summary|striptags|truncate(200)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions