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

Fixes Issue #44 #58

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fixes Issue #44 #58

wants to merge 4 commits into from

Conversation

acmitch
Copy link

@acmitch acmitch commented Apr 7, 2015

Recreated this pull request to clean up the chatter and many commits.

This fixes issue #44 by chaning this:

# remove <!DOCTYPE 
$doc->removeChild($doc->doctype);           

# remove <html><body></body></html> 
$doc->replaceChild($doc->firstChild->firstChild->firstChild, $doc->firstChild);

which only works if <body> has only one child node, to this:

$domElements = $TMPDocument->getElementsByTagName('body')->item(0);
if( !empty($domElements) and $domElements->hasChildNodes() ){
    foreach ($domElements->childNodes as $child){
        $DOMDocument->appendChild($DOMDocument->importNode($child, true));
    }
}

and adding a wrapper function processTags to processTag handling the multiple instances.

Also, please add label to the textLevelElements array.

@@ -455,10 +455,28 @@ protected function parseAttributeData($attributeString)
return $Data;
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

ignores the list of voided elements when rendering markdown
Stabilizes library by revamping class to utilize methods from php 5.4
or greater.
Does an extra check on valid DOMElements to make sure they have child
nodes before calling recursively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants