includes/Parser.php
public function parseE(\DOMElement $e) {
		$classTitle = $this->parseValueClassTitle($e);

		if ($classTitle !== null)
			return $classTitle;

		// Expand relative URLs within children of this element
		// TODO: as it is this is not relative to only children, make this .// and rerun tests
		$this->resolveChildUrls($e);

		// Temporarily move all descendants into a separate DocumentFragment.
		// This way we can DOMDocument::saveHTML on the entire collection at once.
		// Running DOMDocument::saveHTML per node may add whitespace that isn't in source.
		// See https://stackoverflow.com/q/38317903
		$innerNodes = $e->ownerDocument->createDocumentFragment();
		while ($e->hasChildNodes()) {
			$innerNodes->appendChild($e->firstChild);
		}
		$html = $e->ownerDocument->saveHtml($innerNodes);
		// Put the nodes back in place.
		if($innerNodes->hasChildNodes()) {
			$e->appendChild($innerNodes);
		}

		$return = array(
			'html' => unicodeTrim($html),
			'value' => $this->textContent($e),
		);

		if($this->lang) {
			// Language
			if ( $html_lang = $this->language($e) ) {
				$return['lang'] = $html_lang;
			}
		}

		return $return;
	}
public function parseE(\DOMElement $e) {
		$classTitle = $this->parseValueClassTitle($e);

		if ($classTitle !== null)
			return $classTitle;

		// Expand relative URLs within children of this element
		// TODO: as it is this is not relative to only children, make this .// and rerun tests
		$this->resolveChildUrls($e);

		// Temporarily move all descendants into a separate DocumentFragment.
		// This way we can DOMDocument::saveHTML on the entire collection at once.
		// Running DOMDocument::saveHTML per node may add whitespace that isn't in source.
		// See https://stackoverflow.com/q/38317903
		$innerNodes = $e->ownerDocument->createDocumentFragment();
		while ($e->hasChildNodes()) {
			$innerNodes->appendChild($e->firstChild);
		}
		$html = $e->ownerDocument->saveHtml($innerNodes);
		// Put the nodes back in place.
		if($innerNodes->hasChildNodes()) {
			$e->appendChild($innerNodes);
		}

		$return = array(
			'html' => unicodeTrim($html),
			'value' => $this->textContent($e),
		);

		if($this->lang) {
			// Language
			if ( $html_lang = $this->language($e) ) {
				$return['lang'] = $html_lang;
			}
		}

		return $return;
	}
public function parseE ( \ DOMElement $ e ) { $ classTitle = $ this -> parseValueClassTitle ( $ e ) ; if ( $ classTitle !== null ) return $ classTitle ; // Expand relative URLs within children of this element // TODO: as it is this is not relative to only children, make this .// and rerun tests $ this -> resolveChildUrls ( $ e ) ; // Temporarily move all descendants into a separate DocumentFragment. // This way we can DOMDocument::saveHTML on the entire collection at once. // Running DOMDocument::saveHTML per node may add whitespace that isn't in source. // See https://stackoverflow.com/q/38317903 $ innerNodes = $ e -> ownerDocument -> createDocumentFragment ( ) ; while ( $ e -> hasChildNodes ( ) ) { $ innerNodes -> appendChild ( $ e -> firstChild ) ; } $ html = $ e -> ownerDocument -> saveHtml ( $ innerNodes ) ; // Put the nodes back in place. if ( $ innerNodes -> hasChildNodes ( ) ) { $ e -> appendChild ( $ innerNodes ) ; } $ return = array ( 'html' => unicodeTrim ( $ html ) , 'value' => $ this -> textContent ( $ e ) , ) ; if ( $ this -> lang ) { // Language if ( $ html_lang = $ this -> language ( $ e ) ) { $ return [ 'lang' ] = $ html_lang ; } } return $ return ; }
Given the root element of some embedded markup, return a string representing that markup

@param DOMElement $e The element to parse
@return string $e’s innerHTML

@todo need to mark this element as e- parsed so it doesn’t get parsed as it’s parent’s e-* too
Given the root element of some embedded markup return a string representing that markup