You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to affect all blocks; code blocks and what not. Textile replaces all instances of newlines with hard-coded number;
In Parser::cleanWhiteSpace() every CRLF and CR are truncated down to one LF...
...any left over empty lines (lines containing only whitespace, e.g. tabs, LF\t) are replaces with LF
Then three or more LFs are truncated to down to two.
The output alterations start there. Output can never contain more than two LFs, but that doesn't really matter, since the parser itself doesn't output the whitespace it was given:
Parser::blocks() splits given text to blocks by every instance of two LFs; the cleaning makes sure the document contains nothing, but LFLF and LF. There are no whitespace lines left at this point.
It then goes over the blocks, formats them.
Blocks are joined by two LFs, and lines in those blocks with some number.
For instance for bc its one, but there are inline code tags which kinda result in correct formatting; well, up to one empty line (the correct formatting itself is side-affect). In pre. and notexile. where there are no line wrappers, the resulting markup contains no empty lines.
I was trying to fix this by simply joining lines correctly, but looking at the issue closer, this may really need a bigger rewrite. The newline and whitespace cleaning at least needs to go. It can replace CRLF and CR with single LF, but nothing more. Anything else results in noticeable alterations.
The block parser should be changed to preg_split and the match stored and passed down to block formatters. The hard-coded join value removed, and each block is joined by what it was split with. Same for lines.
http://forum.textpattern.com/viewtopic.php?pid=274764
Example:
Should preserve the empty line but does not.
The text was updated successfully, but these errors were encountered: