Skip to content

terminal-labs/lektor-strip-html-tags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lektor-strip-html-tags

This is a simple Lektor plugin that creates a template filter to remove HTML tags from a string. The use it was created for was to do processing on HTML outputted from a Markdown content field. The Markdown is rendered into HTML, and this filter can turn that into simple text, which was then passed to the lektor-natural-language filters to get keywords, unsullied by things like <div> tags.

Example usage:

{{ this.body|striphtmltags }}

{% set var = '<p><strong>Hello</strong>World!</p>' %}
{{ var|striphtmltags }}

The last example will render as "Hello World!"

About

Strip HTML tags, effectively turning HTML into plain text.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages