Class EmptyParagraphPostprocessor
- All Implemented Interfaces:
org.asciidoctor.extension.Processor
IKE topics carry their index terms as standalone indexterm:[...]
lines after the section title, separated from the body by a blank line. In
the html5 backend index terms produce no visible output, so that
blank-line-delimited block renders as an empty
<div class="paragraph"><p></p></div>. Sitting between a heading and
its first real paragraph, this zero-height block occupies the heading's
page-break-after: avoid "keep-with-next" slot in CSS Paged Media
(Prince, Antenna House, WeasyPrint): the heading binds to the empty
paragraph — which always fits — and the real content breaks to the next
page, stranding the heading alone at the page foot.
This processor strips those empty paragraphs so the heading binds to its
real first block. It is intentionally scoped to html5: the
DocBook→FO and Prawn PDF paths render index terms into a real index
(nothing to strip there) and use native keep-with-next on titles, so they
neither exhibit the orphan nor should lose their index entries.
Registered per-execution in the asciidoctor-maven-plugin
configuration (like KonceptGlossaryProcessor), never via SPI: an
SPI-registered Postprocessor crashes the Prawn backend in PostprocessorProxy
before any backend guard could run.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty-paragraph postprocessor instance. -
Method Summary
Methods inherited from class org.asciidoctor.extension.BaseProcessor
createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createDocument, createList, createList, createList, createListItem, createListItem, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createSection, createSection, createSection, createSection, createSection, createTable, createTable, createTableCell, createTableCell, createTableCell, createTableCell, createTableColumn, createTableColumn, createTableRow, getConfig, log, newCursor, newCursor, newCursor, newReader, newReader, newReader, newReader, parseContent, setConfig, unwrap, updateConfig
-
Constructor Details
-
EmptyParagraphPostprocessor
public EmptyParagraphPostprocessor()Creates a new empty-paragraph postprocessor instance.
-
-
Method Details
-
process
Strips empty paragraph blocks from thehtml5output; returns other backends' output unchanged.- Specified by:
processin classorg.asciidoctor.extension.Postprocessor- Parameters:
document- the converted document (used only to read the backend)output- the rendered document output- Returns:
- the output with empty paragraph blocks removed (html5 only)
-