26 if (! defined(
'ENT_SUBSTITUTE')) {
27 define(
'ENT_SUBSTITUTE', 0);
35 private $highlightRenderer;
39 $this->highlightRenderer = $highlightRenderer;
50 $state =
new HighlightState($this->highlightRenderer, $insertBacklink);
51 $result = $this->
render($fragment, $state,
new PagedTextResult($fragment->getStartOffset()), $splitPositions);
52 return $result->getText();
63 $result = $this->
render($fragment, $state,
new PagedHexResult($fragment->getStartOffset(), $state), $splitPositions);
64 return $result->getText();
76 foreach ($splitPositions as $actionPosition => $entries) {
77 $isBeforeVisibleRange = $actionPosition < $fragment->getStartOffset();
78 $isAfterVisibleRange = $actionPosition >= $fragment->getEndOffset();
79 if ($isBeforeVisibleRange || $isAfterVisibleRange) {
99 if ($isAfterVisibleRange) {
render(TextFragment $fragment, HighlightState $state, PagedResult $result, $splitPositions=array())
processEntriesWithinVisibleRange(TextFragment $fragment, HighlightState $state, PagedResult $result, $actionPosition, $entries)
insertElements($entries, PagedResult $result)
closeOpenElements(PagedResult $result)
finalizeContentText(TextFragment $fragment, HighlightState $state, PagedResult $result)
processSplitEntries($entries)
processEntriesOutsideVisibleRange(TextFragment $fragment, HighlightState $state, PagedResult $result, $entries, $isAfterVisibleRange)
openExistingElements(PagedResult $result)
renderHex(TextFragment $fragment, $splitPositions=array())
renderText(TextFragment $fragment, $splitPositions=array(), $insertBacklink=false)