Closed Kilenaitor closed 6 years ago
Thanks - what version are you using? I'm not able to reproduce the problem with this script, or by attempting to add to unit tests:
https://gist.github.com/fredemmott/95e9e497622891077fd7855a67061a30
Hey Fred. I'm using v1.0; latest version I see on packagist. Actually realized the issue. JSON-encoded the string and printed it out. The one I was getting from the database had Windows-style newlines \r\n
instead of just the standard \n
.
I did a simple
$markdown = preg_replace('~\r\n?~', "\n", $markdown);
where $markdown
is my string and it was properly parsed by fbmarkdown
. So it looks like it's a thing regarding newlines. Not sure if it's something to fix or at least better document, but yeah; doing the preg_replace
beforehand fixed it. :)
Thanks - yep, this is a bug :)
From spec:
A line ending is a newline (U+000A), a carriage return (U+000D) not followed by a newline, or a carriage return and a following newline.
fbmarkdown incorrectly only accepts newlines as line endings.
Rendering of blockquotes is currently broken. No matter how many newlines exist after the blockquote line ends it still rendered as part of that blockquote.
Example 1 Raw:
Rendered:
Example 2
Raw:
Rendered:
Relevant render function
Raw input:
HTML output from render: