Forums

WordPress SEO by Yoast
[resolved] Breadcrumbs no longer allow HTML (14 posts)

  1. baritoneuk
    Member
    Posted 10 months ago #

    I updated all my sites to the latest version of the SEO plugin and found that all the breadcrumbs outputted the raw html.

    The SEO plugin used to allow html in the breadcrumb settings:
    Separator between breadcrumbs: <span class="divider">/</span></li><li>
    Anchor text for the Homepage: <i class="icon-home"></i> Home

    This allowed me to get my theme (based on Twitter Bootstrap) working the way I wanted (i.e. get breadcrumbs to output as a list and using a home icon button)

    I noticed previously that the breadcrumbs settings page didn't like HTML and cut it off at the ", but it still worked really well on the front end.

    Now it seems that the breadcrumbs converts all the entities directly and so I can't use HTML.
    http://wordpress.org/extend/plugins/wordpress-seo/

  2. NemoPS
    Member
    Posted 10 months ago #

    Having the exact same issue

  3. baritoneuk
    Member
    Posted 10 months ago #

    Just looked at the update log and seen that the Breadcrumbs has been completely rewritten and now use rich snippets - http://support.google.com/webmasters/bin/answer.py?hl=en&answer=185417

    I'm all for this and I think it's a great idea. However, this is going to make it more difficult to customise and it still outputs without using a list. It would be great if there was a setting to allow to output as a list, choose a divider (eg. <span class="divider">/</span>) and allow html generally (for example putting a home icon for home eg <i class="icon-home"></i> Home

    I don't think there is a work around at the moment for what I do as I can't even turn rich snippets off (something I'd be reluctant to do, but would make things easier)

  4. toekneestuck
    Member
    Posted 10 months ago #

    I agree, I use(d) HTML in my separators. I think this is pretty critical to keep as a developer—without it limits how we can style the breadcrumbs.

  5. thomask
    Member
    Posted 10 months ago #

    The problem is with /wordpress-seo/frontentd/class-breadcrumbs.php row 238

    replace

    $output .= esc_html( " $sep " );
    with
    $output .= " $sep " ;

  6. baritoneuk
    Member
    Posted 10 months ago #

    Thanks, Thomask- works really well. I also had to change the link text and url lines to remove the esc_html bit:

    $link['text'] = $link['text'];
    $link['url']  = $link['url'];
  7. baritoneuk
    Member
    Posted 10 months ago #

    I have to say I don't really like changing the code of plugins over multiple sites- it's a pain to manage- especially when an update comes along. Hopefully this can be looked into?

  8. thomask
    Member
    Posted 10 months ago #

    i think that yoast will take it as other bug reports and will quickly resolve it. So take it just as a quick fix

  9. Joost de Valk
    Member
    Plugin Author

    Posted 10 months ago #

    Hmm to be honest, I'm wondering why I would or would not allow HTML there... I'll allow it back in in the next release.

  10. thomask
    Member
    Posted 10 months ago #

    I told you - yoast is a king ;-)

  11. baritoneuk
    Member
    Posted 10 months ago #

    Fabulous! Really good news.

    I know there are different thoughts on this one, but what's the thought on making the breadcrumbs outputted as an unordered list or at least giving the option of this?

  12. Ricky Lee
    Member
    Posted 1 month ago #

    Any chance this will get remedied soon?

  13. baritoneuk
    Member
    Posted 1 month ago #

    Ricky, what are you referring to? The HTML or it not being coded as a list? I haven't looked recently, but does the plugin not allow HTML in the breadcrumbs? It's a shame if it doesn't. Ideally the plugin should allow more customisation for this.

  14. ciaranlyons
    Member
    Posted 1 month ago #

    I can confirm that this escaping issue still exists in v1.4.6.

    I had the identical scenario, trying to use Font Awesome to render a Home icon using the HTML <i class="icon-home"></i>

    I fixed it by changing line 265 from

    $link_output .= '<a href="' . esc_url( $link['url'] ) . '" rel="v:url" property="v:title">' . esc_html( $link['text'] ) . '</a>';

    to
    $link_output .= '<a href="' . esc_url( $link['url'] ) . '" rel="v:url" property="v:title">' . $link['text'] . '</a>';

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.