Why not parsed?

#33 · closed · 6 comments

View on GitHub ↗

lexus27

I have this RST Code ``` Hello world =========== ``` But render is plaintext, in `<p>Hello world\r\n===========\r\n</p>` I used example from README.md ``` $parser = new \Gregwar\RST\Parser; $value = (string)$parser->parse($value); ``` Now I used the whole sample: ``` Hello world =========== What is it? ---------- This is a **RST** document! Where can I get it? ------------------- You can get it on the `GitHub page <https://github.com/Gregwar/RST>`_ ``` and what I see: ``` <p>Hello world =========== </p> <p>What is it? ---------- This is a <strong>RST</strong> document! </p> <p>Where can I get it? ------------------- You can get it on the <a href="https://github.com/Gregwar/RST">GitHub page</a> </p> ``` a link and bolder is right rendered, but heading is not correctly

Comments

lexus27

I find reasons: `<CRLF>` not supported. It is necessary to implement a forced substitution `\r\n` to `\n` before parse `str_replace("\r\n","\n", $value);` If the line `Hello word\r` and next `======\r`, then the parsing is not correct

Gregwar

Hello Ok, would you mind creating a PR for this?

Gregwar

Plus unit test ;-)

Gregwar

I fixed this

lexus27

I could not do PR, because I have not changed Gregwar/RST core of my changes were outside, and you know better than the more efficient approach to internal architecture), why should I spoil your kernel with their crutches?)

Gregwar

No problem, it's done on master now