Comments (7)
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.
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.
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.
^^ 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.
can you give more info about your environment, OS, PHP version, apache version, etc...
from parsedown-extra.
@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.
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)
- Undefined index: text HOT 4
- Paragraphs/HTML blocks may disappear in HTML block with markdown="1" HOT 3
- ParsedownExtra.php and tests classes are declared as psr-0 in composer.json but are not compliant with psr-0 HOT 11
- Bug: Uninitialized string offset: 1
- Footnote HTML is double-escaped when safe mode is on HOT 1
- Can't embed video HOT 1
- The Footnotes stop working
- I'm getting this while composer update/install HOT 2
- Multiline blockquotes not rendering correctly in multiline footnotes
- Multiple blockquotes HOT 1
- Video HTML tag does not work
- Parsing special attributes {lang=fr} are not parsed HOT 1
- List Item is dropping text that follows a custom tag HOT 2
- PHP 8.2: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated HOT 2
- Wrap image inside div - not working
- Demo broken? HOT 5
- Add support for PHP 8.2 HOT 2
- Deprecated: Use of "self" in callables is deprecated HOT 1
- Should we start looking for alternatives? Is this repo alive? HOT 1
- Deprecated: Use of "self" in callables is deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parsedown-extra.