use of com.enonic.xp.portal.impl.parser.HtmlBlock in project xp by enonic.
the class PostProcessEvaluator method processInstructions.
private HtmlBlocks processInstructions(final HtmlBlocks htmlBlocks) {
final HtmlBlocks.Builder processedHtmlBlocks = HtmlBlocks.builder();
for (HtmlBlock htmlBlock : htmlBlocks) {
if (isInstruction(htmlBlock)) {
final String instructionContent = ((Instruction) htmlBlock).getValue();
final HtmlBlocks processedInstruction = executeInstruction(instructionContent);
if (processedInstruction != null) {
processedHtmlBlocks.addAll(processedInstruction);
}
} else {
processedHtmlBlocks.add(htmlBlock);
}
}
return processedHtmlBlocks.build();
}
use of com.enonic.xp.portal.impl.parser.HtmlBlock in project xp by enonic.
the class PostProcessEvaluator method processContributions.
private HtmlBlocks processContributions(final HtmlBlocks htmlBlocks) {
final HtmlBlocks.Builder processedHtmlBlocks = HtmlBlocks.builder();
for (HtmlBlock htmlBlock : htmlBlocks) {
if (isTagMarker(htmlBlock)) {
final HtmlTag htmlTag = ((TagMarker) htmlBlock).getTag();
final StaticHtml injectionHtml = evalPostProcessInjection(htmlTag);
if (injectionHtml != null) {
processedHtmlBlocks.add(injectionHtml);
}
} else {
processedHtmlBlocks.add(htmlBlock);
}
}
return processedHtmlBlocks.build();
}
Aggregations