taufik-nurrohman / parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.
MIT License
60 stars 13 forks source link

Parsing stalls and then fails when string ends in '!' #17

Closed grottohub closed 4 years ago

grottohub commented 4 years ago

Hey there, I've come across an issue when using exclamation points in .md files. I understand that '!' is an identifier for images, but it should be able to recognize when it's not being used for that purpose, yeah?

I'm making a markdown editor for our work's knowledge base and so far this has worked flawlessly, so credit where it's due for sure. But whenever I use an exclamation point in a context that isn't with an ![Image] tag, it takes the page about two minutes to load and then PHP fails after the parser function is called.

Here's a sample of a .md that I parse into a string:

# I am using this page for Markdown Testing
**Please do not remove this page**
***

## To-Do
- ~~Add sticky buttons for _italics_, __bold__, etc.~~
- ~~Include image upload~~
- ~~Include way to hyperlink to other parts of PHD: almost done~~
- Include way to add sections of pages with MD editor 
Test!

The above provides the following after about two minutes: ex1

If I remove 'Test!' it looks like this(load time about 400ms): ex2

And here's proof that images work as intended: ex3

If you need any more info about my project/code structure, let me know and I'll provide it.

taufik-nurrohman commented 4 years ago

What version are you using? Current ParsedownExtraPlugin extension version is 1.2.0. I seem to have experienced this issue before, it’s just that I forgot where.

taufik-nurrohman commented 4 years ago

https://github.com/erusev/parsedown/issues/546

grottohub commented 4 years ago

Yes, I was using an older version, got it updated 👍