• Resolved Tema

    (@madeinua)


    Hi there

    I found one issue: HTML tags added to the post excerpt are visible in the search results.

    I checked source code and found that you applies strip_tags() to the main content but leaves post_except as it is.

    I know that post excerpt not allow html tags by default but this may happen when you add this possibility through hooks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    If you put HTML tags in your excerpt, I think it’s a fair assumption that you actually want them to be there.

    But yeah, a good point, I’ll make sure next version will strip tags from excerpts as well.

    Thread Starter Tema

    (@madeinua)

    If you put HTML tags in your excerpt, I think it’s a fair assumption that you actually want them to be there.

    As option – yes, but Relevanssi convert excerpt to HTML entities. So, as a result you have e.g. & lt; strong & gt; instead of HTML tags.

    • This reply was modified 7 years, 2 months ago by Tema.
    • This reply was modified 7 years, 2 months ago by Tema.
    • This reply was modified 7 years, 2 months ago by Tema.
    Thread Starter Tema

    (@madeinua)

    In this case I would recommend to add this line

    $excerpt = strip_tags($excerpt, get_option('relevanssi_excerpt_allowable_tags', '')); // this removes the tags, but leaves the content

    after this one

    $excerpt === $post->post_content ? $whole_post_excerpted = true : $whole_post_excerpted = false;

    • This reply was modified 7 years, 2 months ago by Tema.
    Plugin Author Mikko Saari

    (@msaari)

    Will do that in the next version, yes.

    Hi,

    I have excerpt indexing disabled but still see html tags. Was the mentioned modification already implemented? If not, where do I have to put it into to test it.

    Thanks a lot
    Mike

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘HTML Tags in Post excerpt’ is closed to new replies.