Class MarkdownSink

All Implemented Interfaces:
AutoCloseable, Markup, TextMarkup, MarkdownMarkup, Sink

public class MarkdownSink extends AbstractTextSink implements MarkdownMarkup
Markdown generator implementation.
Note: The encoding used is UTF-8.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • buffer

      private StringBuilder buffer
      A buffer that holds the current text when headerFlag or bufferFlag set to true. The content of this buffer is already escaped.
    • authors

      private Collection<String> authors
      author.
    • title

      private String title
      title.
    • date

      private String date
      date.
    • linkName

      private String linkName
      linkName.
    • tableHeaderCellFlag

      private boolean tableHeaderCellFlag
      tableHeaderCellFlag, set to true for table rows containing at least one table header cell
    • cellCount

      private int cellCount
      number of cells in a table.
    • cellJustif

      private List<Integer> cellJustif
      justification of table cells per column.
    • isFirstTableRow

      private boolean isFirstTableRow
      is header row
    • writer

      private final PrintWriter writer
      The writer to use.
    • bufferingWriter

      private final LastTwoLinesBufferingWriter bufferingWriter
      A temporary writer used to buffer the last two lines
    • inlineStack

      protected Queue<Queue<String>> inlineStack
      Keep track of end markup for inline events.
    • elementContextStack

      protected Queue<MarkdownSink.ElementContext> elementContextStack
      The context of the surrounding elements as stack (LIFO)
    • figureSrc

      private String figureSrc
  • Constructor Details

    • MarkdownSink

      protected MarkdownSink(Writer writer)
      Constructor, initialize the Writer and the variables.
      Parameters:
      writer - not null writer to write the result. Should be an UTF-8 Writer.
  • Method Details