Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not parsed? #33

Closed
lexus27 opened this issue Oct 14, 2016 · 6 comments
Closed

Why not parsed? #33

lexus27 opened this issue Oct 14, 2016 · 6 comments

Comments

@lexus27
Copy link

lexus27 commented Oct 14, 2016

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

@lexus27
Copy link
Author

lexus27 commented Oct 14, 2016

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
Copy link
Owner

Gregwar commented Oct 14, 2016

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

@Gregwar
Copy link
Owner

Gregwar commented Oct 14, 2016

Plus unit test ;-)

@Gregwar
Copy link
Owner

Gregwar commented Oct 14, 2016

I fixed this

@lexus27
Copy link
Author

lexus27 commented Oct 15, 2016

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
Copy link
Owner

Gregwar commented Oct 15, 2016

No problem, it's done on master now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants