开发者

PHP Markdown \n Question

开发者 https://www.devze.com 2022-12-13 04:13 出处:网络
I\'m using http://michelf.com/projects/php-markdown/ for my markdown library and my question is that if i edit and remove the \\n\\n functionality would this work

I'm using http://michelf.com/projects/php-markdown/ for my markdown library and my question is that if i edit and remove the \n\n functionality would this work

Because the users that i have, are quite probably not allowed to run JavaScript therefore i cant开发者_开发问答 count on the preview to be generated dynamically therefore they will make allot of mistakes using \n instead of \n\n

So the question is: is it essential for the library to use the \n\n for the reg ex manipulation?


After doing some research and looking at the markdown convertion, ive noticed that it can be done in such way:

Say for example we have text:

asdf
asdf
asdf

asdf
asdf
asdf

The output of this in Pure text Markup will be:

<p>asdf
asdf
asdf</p>

<p>
asdf
asdf
asdf</p>

So to replace the \n must only be done inside the <p> tags

0

精彩评论

暂无评论...
验证码 换一张
取 消