const NO_TEMPLATES = 2;
const STRIP_COMMENTS = 4;
const NO_IGNORE = 8;
+ const RECOVER_COMMENTS = 16;
- const RECOVER_ORIG = 11;
+ const RECOVER_ORIG = 27; // = 1|2|8|16 no constant expression support in PHP yet
/**
* Create a child frame
$fakeLineStart = true; # Do a line-start run without outputting an LF character
while ( true ) {
- if ( ! ($i % 10) ) $this->memCheck();
+ //$this->memCheck();
if ( $findOnlyinclude ) {
// Ignore all input up to the next <onlyinclude>
}
} elseif ( $contextNode->nodeName == 'comment' ) {
# HTML-style comment
+ # Remove it in HTML, pre+remove and STRIP_COMMENTS modes
if ( $this->parser->ot['html']
|| ( $this->parser->ot['pre'] && $this->parser->mOptions->getRemoveComments() )
|| ( $flags & self::STRIP_COMMENTS ) )
{
$out .= '';
- } else {
+ }
+ # Add a strip marker in PST mode so that pstPass2() can run some old-fashioned regexes on the result
+ # Not in RECOVER_COMMENTS mode (extractSections) though
+ elseif ( $this->parser->ot['wiki'] && ! ( $flags & self::RECOVER_COMMENTS ) ) {
+ $out .= $this->parser->insertStripItem( $contextNode->textContent );
+ }
+ # Recover the literal comment in RECOVER_COMMENTS and pre+no-remove
+ else {
$out .= $contextNode->textContent;
}
} elseif ( $contextNode->nodeName == 'ignore' ) {