Giter Club home page Giter Club logo

Comments (7)

cebe avatar cebe commented on August 17, 2024

This seems to be related to your environment. The following markdown parses just fine:

![alt](64esabbase64eyppbWc6Y3JvcEZpdCg1MDAsMjYwKTpzaXplcygnKG1heC13aWR0aDogNzY4cHgpIDI1dncnLCAnKG1pbi13aWR0aDogMTAwMHB4KSAyMjVweCcsICcxNjBweCcpOnNyY1NldCgnMTIwLDAnLCAnMTg1LDAnLCAnMjI1LDAnKTpsaWdodGJveChyb3V0ZS01MTUpKn0=64esabbase64/img/diversen/klantfotos/2014-klantenfotos/facebook-overig/brandenburg-sabine-horseshoe-bend.JPG 'Page, Horseshoe Bend foto Sabine Brandenburg')

You can try it on the demo page: http://parsedown.org/extra/

from parsedown-extra.

storeman avatar storeman commented on August 17, 2024

It indeed seems to be the environment. I did a few more tests. With the same configuration file on the same system, the script ran fine through the command line. But through the browser it crashes very hard. It takes a while (about 10 seconds) before the error is returned. The only difference between command line and browser is apache, I cannot imagine that this is the issue.

Also tried a few browsers, all the same. I'm going to dig a little deeper, can't stand something like this.

from parsedown-extra.

hkdobrev avatar hkdobrev commented on August 17, 2024

By the way as far as I know parsedown.org also runs Apache. So it could depend on specific Apache version or configuration.

from parsedown-extra.

storeman avatar storeman commented on August 17, 2024

^^ That could be. But I narrowed it down to the following regex on inlineLink:

'/^[(]((?:[^ ()]|[(][^ )]+[)])+)(?:[ ]+("[^"]*"|\'[^\']*\'))?[)]/'

I tried to simplify it, and that was possible, but not without breaking tests and compatibility. I can't yet solve the exact issue, but the first part of the regex (the url) contains a lot of nesting and that is were apache crashes on such a long link. I think any system might run into this issue with longer links.

from parsedown-extra.

cebe avatar cebe commented on August 17, 2024

can you give more info about your environment, OS, PHP version, apache version, etc...

from parsedown-extra.

hkdobrev avatar hkdobrev commented on August 17, 2024

@storeman I'm not sure, but there could be a very memory-intensive regex with certain input. What is your memory limit for PHP in Apache? Also how is the script crashing? Have you turned on error_reporting()?

from parsedown-extra.

storeman avatar storeman commented on August 17, 2024

My Environment:
PHP5.6.8, Apache 2.4.10 (virtual server), Apache2Handler, Windows 8.1.

@hkdobrev It just crashes and restarts apache. No output, no data in the logs (only in apache it . On windows cmd it runs well (with the same INI, thus same memory limit). I also disabled all modules in PHP, this didn't change anything.

One of the main problems is the allowance of braces in the url. This is now matching only closing braces if there is an opening brace. This is inconsisten behavior, because it would allow:

[test](/i/am/an/(url))

But it would not allow

[test](/i/am/an/)url)

I think it would be better to allow urls to be quoted, but that would be a major breaking change, i imagine.

from parsedown-extra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.