Post.content exlude tags

Is there any way to exclude certain HTML tags which are included in {{ post.content }} ?
I’d like to exclude code from being included because I’m counting words to make a time estimate and using post.content with inclusion of words in my code’s <highlight> tag causes incorrect estimates =)

I think you are looking for this:

1 Like

Thanks, that is useful but maybe I should’ve been less ambiguous. I would like to also remove the content between the <highlight> tags, ideally before using strip_html. Something like {% post.content | remove_stuff_between_specified_tags | strip_html would be what I’m looking for!
Thanks again :slight_smile:

If you are not just GH Pages you can add a plugin and use it with regex pattern to remove content between highlight tags.

How inaccurate are your estimates? The output as code should count to reading time. Unless it is breaking it up weirdly into words to handle the highlighting

1 Like

Or use this plugin. Again not in GH Pages unless you use GH Actions

1 Like