mrclay / old-misc

Old classes, components, functions, and other nonsense (formerly at Google code)
6 stars 4 forks source link

AutoP: Whitespace stripping causes issues with link activation #7

Open mapkyca opened 6 years ago

mapkyca commented 6 years ago

I activate links to profiles, e.g.

@mapkyca some text will get expanded as <a href="https://twitter.com/mapkyca">@mapkyca</a> some text

If I pass this through autop, the whitespace after the gets stripped, so you get <a href="https://twitter.com/mapkyca">@mapkyca</a>some text

Setting $ltrimFirstTextNode = false; in AutoP.php seems to fix this, so maybe we just need to make this configurable..?

mrclay commented 6 years ago

It shouldn't be stripping white space around an a element. That seems like the bug, but I haven't looked at this in awhile.

mrclay commented 6 years ago

Setting $ltrimFirstTextNode = false for a whole operation will probably break a bunch of things. I have a test for this.

mapkyca commented 6 years ago

Hmm... seems sufficient to set $ltrimFirstTextNode = false in the if ($alterInline) { block, although I don't know the code so I can't say if this'll screw anything up...