michael-o commented on code in PR #197: URL: https://github.com/apache/maven-doxia/pull/197#discussion_r1460319080
########## doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownSink.java: ########## @@ -64,56 +66,81 @@ public class MarkdownSink extends AbstractTextSink implements MarkdownMarkup { /** linkName. */ private String linkName; - /** startFlag. */ - private boolean startFlag; - - /** tableCaptionFlag. */ - private boolean tableCaptionFlag; - - /** tableCellFlag, set to {@code true} inside table (header) cells */ - private boolean tableCellFlag; - - /** tableRowHeaderFlag, set to {@code true} for table rows containing at least one table header cell */ + /** tableHeaderCellFlag, set to {@code true} for table rows containing at least one table header cell */ private boolean tableHeaderCellFlag; - /** headerFlag. */ - private boolean headerFlag; - - /** bufferFlag, set to {@code true} in certain elements to prevent direct writing during {@link #text(String, SinkEventAttributes)} */ - private boolean bufferFlag; - - /** verbatimFlag. */ - private boolean verbatimFlag; - - /** figure flag, set to {@code true} between {@link #figure(SinkEventAttributes)} and {@link #figure_()} events */ - private boolean figureFlag; - /** number of cells in a table. */ private int cellCount; - /** The writer to use. */ - private final PrintWriter writer; - - /** {@code true} when last written character in {@link #writer} was a line separator, or writer is still at the beginning */ - private boolean isWriterAtStartOfNewLine; - /** justification of table cells per column. */ private List<Integer> cellJustif; /** is header row */ private boolean isFirstTableRow; - /** listNestingLevel, 0 outside the list, 1 for the top-level list, 2 for a nested list, 3 for a list nested inside a nested list, .... */ - private int listNestingLevel; + /** The writer to use. */ + private final PrintWriter writer; + + /** {@code true} when last written character in {@link #writer} was a line separator, or writer is still at the beginning */ + private boolean isWriterAtStartOfNewLine; - /** listStyles. */ - private final Stack<String> listStyles; + /** Keep track of end markup for inline events. */ + protected Queue<Queue<String>> inlineStack = Collections.asLifoQueue(new LinkedList<>()); - /** Keep track of the closing tags for inline events. */ - protected Stack<List<String>> inlineStack = new Stack<>(); + /** The context of the surrounding elements as stack (LIFO) */ + protected Queue<ElementContext> elementContextStack = Collections.asLifoQueue(new LinkedList<>()); Review Comment: Stupid question: Why not use a stack directly? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org