symphonycms / markdown

Markdown Text Formatter for Symphony CMS
http://symphonyextensions.com/extensions/markdown/
Other
7 stars 12 forks source link

Nonsense results, invalid HTML #8

Open michael-e opened 10 years ago

michael-e commented 10 years ago

The Markdown extension seems to do nonsense, at least since version 1.10 (which is the oldest version that I could test with Symphony 2.3.6).

Using the Markdown formatter and the following input:

<p>Hello</p>
<p>Michael</p>
<p>E.</p>

I get this result:

<p>Hello</p>

<p><p>Michael</p>
<p>E.</p></p>

Using Markdown (With HTML Purifier) and the same input get the following result:

<p>Hello</p>

<p></p><p>Michael</p>
<p>E.</p>

Both is terribly wrong. Markdown shouldn't touch valid HTML.

How can this be?

iwyg commented 10 years ago

As far as I remember, the markdown parser isn't written by the Symphony team, nor is the html purifier. So better to inform Michel Fortin (markdown) on this potential bug (don't know where the html purifier lib comes from).

iwyg commented 10 years ago

@symphonycms apart form that. There're a lot of well working md libs out there nowadays. Would switching be an option?

EDIT: https://github.com/dotink/markdown and its variations are really good.

michael-e commented 10 years ago

Indeed! I tested the Dingus, and it shows the same result! Hard to believe.

John Gruber's Markdown dingus page works fine, however. :-)

michael-e commented 10 years ago

Parsedown looks pretty interesting.

michael-e commented 10 years ago

But it seems to have some serious bugs. :-(

michael-e commented 10 years ago

I informed Michel Fortin. BTW, the issue is in "Markdown", but doesn't arise with the "Markdown Extra" flavour.

Maybe I will work around this by wrapping the original PERL version of Markdown into a textformatter. (I don't use any extended Syntax anyway.)

jensscherbl commented 10 years ago

@michael-e Maybe give CommonMark a try?

michael-e commented 10 years ago

That looks very interesting, but wouldn't be 100 percent backward-compatible for me. I haven't read the complete spec, but I have found at least one CommonMark rule that would make problems with the "personal notation preference" of some of my authors.

Thanks for pointing me to your extension!

michael-e commented 9 years ago

Still no news on the PHP Markdown issue.

@jensscherbl: I will probably use CommonMark in a current project, and I don't expect any issues (given the simplicity of your extension). Otherwise, well... I will send the usual alarms then. :-)

nitriques commented 9 years ago

@michael-e Maybe give CommonMark a try?

I've been using @jensscherbl CommonMark as soon as it got released and I am really pleased with it. I also adapted the editor_for_symphony extensions in order to make it work with CommonMark.

jensscherbl commented 9 years ago

The library I use is now part of thephpleague.com, by the way.

It's still moving pretty fast regarding new version numbers at the moment, so my extension isn't always up-to-date, but shouldn't be a problem. Plus you could always try and update the dependency via composer on your own.

There's also a standalone HTML Purifier extension now, but not very useful at the moment. I really hope to find some time to continue work on fields and text formatters soon.