Forums

Advanced Excerpt should close unclosed tags (6 posts)

  1. archon810
    Member
    Posted 2 years ago #

    If the excerpt cuts the text in the middle of an open tag, it should be forcefully closed, otherwise the tag will apply to the rest of the page.

    For example, "blabla <b>more bla...<<<excerpt ends here"

    http://wordpress.org/extend/plugins/advanced-excerpt/

  2. basvd
    Member
    Posted 2 years ago #

    The plugin already attempts to correct unclosed tags. It says so in the description, please read it.

    If this feature is broken, please describe the situation that caused it to fail.

  3. archon810
    Member
    Posted 2 years ago #

    OK, after looking into this further, I narrowed it down to the following:

    <strong><em>blabla[...]</em></strong>

    What happens is the trailing excerpt string that signifies the end of it ([...]) is getting included into the <strong><em> block. Additionally, I do a replacement of [...] with a custom string like "View the rest of this post", which makes this formatting issue even worse.

    I'm not sure if there's a good solution here - ideally your plugin would run before the_excerpt() has a chance to insert its crap... is there a hook you can hook into before the_excerpt?

  4. archon810
    Member
    Posted 2 years ago #

    Edit: I think actually the [...] string comes in from your plugin as that's what is specified in the plugin options, so I'm sure you could fix it.

    And btw, the reason I didn't use the full "View the rest of this post" in your plugin directly is because I wanted to wrap it into an <a> tag but see no way of doing it from within that option field.

  5. basvd
    Member
    Posted 2 years ago #

    Adding a link is not yet possible with this plugin, but I will add this feature.

    The ellipsis issue is kind of a problem. In most cases we want it outside of the HTML markup, but there is at least one occassion in which the ellipsis should be inside the markup: when the last tag is a paragraph (p). Otherwise the ellipsis is placed on the next line.

    I'm currently looking for a solution, though.

  6. archon810
    Member
    Posted 2 years ago #

    Bas, I updated to the latest version and disabled my functions.php fix. I think the ellipsis bug is fixed, if I'm not mistaken.

    Also, I got everything to work with the link but there's only 1 problem - I added a <div class='bla'> into both ellipsis and read more text fields and the quotes got escaped (with one \ for single quotes and 3 \ for double quotes (hrm?)). It's not a huge problem - I took out the quotes altogether, but it'd be nice to see a proper fix, in case I ever want to have 2 classes for one div.

    Thanks.

    Artem
    http://beerpla.net
    http://twitter.com/ArtemR

Topic Closed

This topic has been closed to new replies.

About this Topic