Exemplo n.º 1
0
 /**
  * @param TextFragment $fragment
  * @param HighlightState $state
  * @param PagedResult $result
  */
 protected function finalizeContentText(TextFragment $fragment, HighlightState $state, PagedResult $result)
 {
     if ($result->getCurrentOffset() < $fragment->getEndOffset()) {
         if ($result->isEmpty()) {
             $state->openExistingElements($result);
         }
         $result->appendContentText($fragment->getSlice($result->getCurrentOffset()));
         $state->closeOpenElements($result);
     }
 }
Exemplo n.º 2
0
 /**
  * @param $result
  */
 public function openExistingElements(PagedResult $result)
 {
     foreach ($this->elementStack as $entry) {
         $result->appendMetaText($this->highlightRenderer->createSpanStart($entry));
     }
 }