Announcement
Texy! is consuming my spaces…
9 years ago
- matthew180
- Member | 3
IHMO, Texy! should not modify my input other than the documented markup, however it seems Texy! will eat spaces. Browsers will already do this, so Texy! should not. With the use of CSS, you can't always check where fixed formatting is used, i.e. inside pre, textarea, and script tags. With CSS “white-space: pre;” I can set fixed formatting for anything, and I was doing this for a code block on my site.
I found the code where Texy! was eating the spaces and removed the check. The quick fix is to change line 148 in TexyHtmlOutputModule.php:
Original:
else $s = preg_replace(‘#[ \n]+#’, ' ', $mText);
Change:
else $s = Texy::freezeSpaces($mText);
A permanent fix would be to just remove the checks for extra spaces and just leave the source alone. Or, set up another configurable option to allow the developer to chose to have Texy! ignore the extra spaces.
Matthew