Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOMDocument::saveHTML() with $node parameter on php < 5.3.6 #75

Closed
Lomanic opened this issue Sep 15, 2015 · 0 comments
Closed

DOMDocument::saveHTML() with $node parameter on php < 5.3.6 #75

Lomanic opened this issue Sep 15, 2015 · 0 comments
Labels

Comments

@Lomanic
Copy link

Lomanic commented Sep 15, 2015

As discussed here, Parsedown-extra now uses uses DOMDocument::savehtml() with the $node parameter, and so we need PHP 5.3.6 (see savehtml()'s Changelog), testing with php 5.3.3 gives the following errors:

Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given in /var/home/XXX/www/picocms4/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 492
Warning: DOMDocument::loadHTML(): Empty string supplied as input in /var/home/XXX/www/picocms4/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 471
Catchable fatal error: Argument 1 passed to DOMNode::removeChild() must be an instance of DOMNode, null given, called in /var/home/XXX/www/picocms4/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 496 and defined in /var/home/XXX/www/picocms4/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 472

You should at least add this requirement in your composer.json as below

{
    "name": "erusev/parsedown-extra",
    "description": "An extension of Parsedown that adds support for Markdown Extra.",
    "keywords": ["markdown", "markdown extra", "parser", "parsedown"],
    "homepage": "https://github.com/erusev/parsedown-extra",
    "type": "library",
    "license": "MIT",
    "authors": [
        {
            "name": "Emanuil Rusev",
            "email": "[email protected]",
            "homepage": "http://erusev.com"
        }
    ],
    "require": {
        "php": ">=5.3.6",
        "erusev/parsedown": "~1.4"
    },
    "autoload": {
        "psr-0": {"ParsedownExtra": ""}
    }
}

Issue related to #44, #57 and #58

@erusev erusev added the issue label Sep 15, 2015
PhrozenByte added a commit to PhrozenByte/parsedown-extra that referenced this issue Jan 6, 2016
PhrozenByte added a commit to PhrozenByte/parsedown-extra that referenced this issue May 26, 2017
Fixes erusev#75, erusev#84

- ext-dom is required due to the use of the DOMDocument class
- ext-mbstring is required due to the use of the mb_convert_encoding() function
PhrozenByte added a commit to picocms/Pico that referenced this issue May 26, 2017
Pico doesn't require the PHP extensions itself, but erusev/parsedown-extra does. The explicit composer.json requirements are necessary until erusev/parsedown-extra#75 gets merged. Both extensions aren't part of Ubuntu's default LAMP setup anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants