Welcome Guest, Not a member yet? Register   Sign In
issue with auto_typography
#1

[eluser]GSV Sleeper Service[/eluser]
I'm getting an extra close paragraph tag if I run text with code tags through auto_typography, example output below.

Code:
<code>$this->badger->mushroom("snake")</p></code>

any idea what's causing this? the close paragraph is not there in the database
#2

[eluser]Référencement Google[/eluser]
Without more infos on what do $this->badger->mushroom("snake") it's difficult to say.
#3

[eluser]GSV Sleeper Service[/eluser]
forget about $this->badger->mushroom("snake"), it was just an example, it means nothing and has nothing to do with this problem. let me explain again

I create some text eg

here is some text<code>example code goes here</code>

when I pass this text through auto_typography() I get

[code]<p>here is some text</p><code>example code goes here</p></code>[code]

and as you can see, an extra close paragraph tag is being added within the code tag.
#4

[eluser]Crimp[/eluser]
Move on to markdown. If you provide the exact phrases used, we may be able to spot the "bug". Basically, regex fails in certain cases. The trouble is then that you can't always control that those cases do not happen and using auto_typography() is therefore not a good idea. Markdown can easily be implemented as a helper.
#5

[eluser]GSV Sleeper Service[/eluser]
well, I've fixed it. I'm not sure if this is a bug, but I fixed it by modifying system/helpers/typography_helper.php.

I changed line 100 from
Code:
var $skip_elements    = 'pre|ol|ul';
to
Code:
var $skip_elements    = 'pre|ol|ul|code';




Theme © iAndrew 2016 - Forum software by © MyBB