Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Multiple "broken" in class attribute of HTML Content

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1477 Views
  • xmedeko
    Avatar
    Community Member
    94 Posts

    Multiple "broken" in class attribute of HTML Content Link to this post

    Hi,

    if you one broken link more times in $Content, e.g. like:
    <p><a href="xxx/">first</a> ... <a href="xxx/">second</a></p>

    then, after a few times of reading the content and saving in CMS, thre is an attribute class="broken broken broken ...".

    I have changed the Field() method in HtmlEditorField.php to avoid this:

    // Mark up broken links
    if ($links) {
    $links = array_unique($links);
    foreach($links as $link) {
    ...

  • xmedeko
    Avatar
    Community Member
    94 Posts

    Re: Multiple "broken" in class attribute of HTML Content Link to this post

    Sorry, one I have missed HTTP::getLinksIn(), so again:

    // Mark up broken links
    $links = HTTP::getLinksIn($content);
    if ($links) {
    $links = array_unique($links);
    foreach($links as $link) {
    ...

  • Andy
    Avatar
    230 Posts

    Re: Multiple "broken" in class attribute of HTML Content Link to this post

    Thanks, I've applied this.

    1477 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.