Enabling the "BLS Filter" for a text format results in the adding of an extra space (" ") after each HTML tag.

I have tracked the issue down to an extra space being added in the _bible_blsanchorize function, and involves changing a single line:

-      $linked_text .= ' '. _bible_blsaddLink($value);
+      $linked_text .= _bible_blsaddLink($value);

Here is the original while loop:

 while (list($key,$value) = each($parsed_text)) {
    if (preg_match($split_regex, $value)) {
      $linked_text .= $value; // If it is an HTML element or within a link, just leave it as is.
    }
    else {
      $linked_text .= ' '. _bible_blsaddLink($value);
    }
  }

Here is the modified while loop.

 while (list($key,$value) = each($parsed_text)) {
    if (preg_match($split_regex, $value)) {
      $linked_text .= $value; // If it is an HTML element or within a link, just leave it as is.
    }
    else {
      $linked_text .= _bible_blsaddLink($value);
    }
  }

I'm not sure why the extra whitespace is included in the function, as it doesn't seem to break anything for me by removing it. I don't have any texts being referenced in any content at the moment, but I might in the near future which is why I have the filter enabled.

Comments

berenddeboer’s picture

Status: Active » Fixed

Could have created a nice patch for this!

  • berenddeboer committed 882edf9 on 7.x-1.x
    Issue #2400775 by dieuwe: BLS Filter adds extra spaces around HTML tags
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.