wiki:xref:dokuwiki:inc:parsing:handler:quote.php
- Quote.php
- <?php
- namespace dokuwiki\Parsing\Handler;
- class Quote extends AbstractRewriter
- {
- /** @inheritdoc */
- public function finalise()
- {
- $this->process();
- $this->callWriter->finalise();
- }
- /** @inheritdoc */
- public function process()
- {
- $quoteDepth = 1;
- foreach ($this->calls as $call) {
- switch ($call[0]) {
- /** @noinspection PhpMissingBreakStatementInspection */
- case 'quote_start':
- // fallthrough
- case 'quote_newline':
- $quoteLength = $this->getDepth($call[1][0]);
- if ($quoteLength > $quoteDepth) {
- $quoteDiff = $quoteLength - $quoteDepth;
- for ($i = 1; $i <= $quoteDiff; $i++) {
- }
- } elseif ($quoteLength < $quoteDepth) {
- $quoteDiff = $quoteDepth - $quoteLength;
- for ($i = 1; $i <= $quoteDiff; $i++) {
- }
- } else {
- }
- $quoteDepth = $quoteLength;
- break;
- case 'quote_end':
- if ($quoteDepth > 1) {
- $quoteDiff = $quoteDepth - 1;
- for ($i = 1; $i <= $quoteDiff; $i++) {
- }
- }
- $this->callWriter->writeCalls($this->quoteCalls);
- break;
- default:
- $this->quoteCalls[] = $call;
- break;
- }
- }
- return $this->callWriter;
- }
- /**
- * @param string $marker
- * @return int
- */
- protected function getDepth($marker)
- {
- return $quoteLength;
- }
- }
Только авторизованные участники могут оставлять комментарии.
wiki/xref/dokuwiki/inc/parsing/handler/quote.php.txt · Последнее изменение: — 127.0.0.1