doc .= $tagAttributes->toHtmlEnterTag("p"); break; case DOKU_LEXER_SPECIAL: $tagAttributes = TagAttributes::createFromCallStackArray($data[PluginUtility::ATTRIBUTES]); $renderer->doc .= $tagAttributes->toHtmlEnterTag("p"); $renderer->doc .= "

"; break; case DOKU_LEXER_EXIT: $renderer->doc .= "

"; break; } return true; case 'metadata': /** @var Doku_Renderer_metadata $renderer */ return true; case Analytics::RENDERER_FORMAT: /** * @var renderer_plugin_combo_analytics $renderer */ return true; } // unsupported $mode return false; } /** * * Transform EOL into paragraph * between the {@link CallStack::getActualCall()} and the {@link CallStack::isPointerAtEnd()} * of the stack * * Info: Basically, you get an new paragraph with a blank line or `\\` : https://www.dokuwiki.org/faq:newlines * * It replaces the {@link \dokuwiki\Parsing\Handler\Block::process() eol to paragraph Dokuwiki process} * that takes place at the end of parsing process on the whole stack * * Info: The `eol` call are temporary created with {@link \dokuwiki\Parsing\ParserMode\Eol} * and transformed to `p_open` and `p_close` via {@link \dokuwiki\Parsing\Handler\Block::process()} * * @param \ComboStrap\CallStack $callstack * @param $class */ public static function fromEolToParagraphUntilEndOfStack(&$callstack, $class) { /** * The attributes passed to the paragraph */ $attributes = array("class" => $class); /** * The syntax plugin that implements the paragraph * ie {@link \syntax_plugin_combo_para} * We will transform the eol with a call to this syntax plugin * to create the paragraph */ $paragraphComponent = \syntax_plugin_combo_para::COMPONENT; /** * The running variables */ $paragraphIsOpen = false; // A pointer to see if the paragraph is open while ($callstack->next()) { $actualCall = $callstack->getActualCall(); if ($actualCall->getTagName() === "eol") { /** * Next Call */ $nextCall = $callstack->next(); $callstack->prev(); if ($nextCall === false) { $nextDisplay = "last"; $nextCall = null; } else { $nextDisplay = $nextCall->getDisplay(); } /** * Processing */ if (!$paragraphIsOpen) { switch ($nextDisplay) { case Call::BlOCK_DISPLAY: case "last": $callstack->deleteActualCallAndPrevious(); break; case Call::INLINE_DISPLAY: $paragraphIsOpen = true; $actualCall->updateToPluginComponent( $paragraphComponent, DOKU_LEXER_ENTER, $attributes ); break; case "eol": /** * Empty line */ $actualCall->updateToPluginComponent( $paragraphComponent, DOKU_LEXER_ENTER, $attributes ); $nextCall->updateToPluginComponent( $paragraphComponent, DOKU_LEXER_EXIT ); $callstack->next(); break; default: LogUtility::msg("The eol action for the combination enter / (" . $nextDisplay . ") of the call ( $nextCall ) was not implemented", LogUtility::LVL_MSG_ERROR); break; } } else { /** * Paragraph is open */ switch ($nextDisplay) { case "eol": /** * Empty line */ $actualCall->updateToPluginComponent( $paragraphComponent, DOKU_LEXER_EXIT ); $nextCall->updateToPluginComponent( $paragraphComponent, DOKU_LEXER_ENTER, $attributes ); $callstack->next(); break; case Call::INLINE_DISPLAY: // A space $actualCall->updateEolToSpace(); break; case Call::BlOCK_DISPLAY: case "last"; $actualCall->updateToPluginComponent( $paragraphComponent, DOKU_LEXER_EXIT ); $paragraphIsOpen = false; break; default: LogUtility::msg("The display for a open paragraph (" . $nextDisplay . ") is not implemented", LogUtility::LVL_MSG_ERROR); break; } } } } // if the paragraph is open close it if ($paragraphIsOpen) { $callstack->insertBefore( Call::createComboCall( \syntax_plugin_combo_para::TAG, DOKU_LEXER_EXIT ) ); } } }