Bug in auto_typography() |
[eluser]Matthew Pennell[/eluser]
This was reported back in February, but there doesn't seem to be any reference to it in the Bug Tracker. I'm using 1.5.4 and still seeing the bug. Input: Code: This is the page all about "getting involved". Output of auto_typography($above_string): Code: <p>This is the page all about “getting involved”.</p> I think it's to do with the 'greedy' way regex matches, so two links in the same block of text are getting a closing/opening P tag wrapped around them.
[eluser]#1313[/eluser]
Ah, there is no point for waiting for such trivial fix. Patch your \system\helpers\typography_helper.php like this: Comment/delete these lines (around line #532): Code: $str = str_replace("\n\n", "</p>\n\n<p>", $str); Insert this: Code: $str = str_replace(array("\r\n", "\r", "\n"), "<br />", $str); UPD: ah, disregard this. this patch may be helpful, but it does not fix the problem being discussed. sorry =) read next post
[eluser]#1313[/eluser]
\system\helpers\typography_helper.php, lines 155-156: Code: $str = preg_replace("#(<.*?)(".$this->block_elements.")(.*?>)#", "</p>\\1\\2\\3", $str); replace with Code: $str = preg_replace("#<(".$this->block_elements.")(.*?)>#", "</p>\\1\\2\\3", $str); Worked for me.
[eluser]Unknown[/eluser]
The solution above worked to fix the problems that anchor tags were having, but it also seemed to break a bunch of other things like unordered lists, b/strong tags at the beginning of paragraphs, etc. Here's an alternative that doesn't break other things. You can add this line just before the 'return $str;' part in the convert() function of auto_typography: Code: $str = preg_replace('#</p><a(.*?)</a><p>#', ' <a\\1</a> ', $str); |
Welcome Guest, Not a member yet? Register Sign In |