[ https://issues.apache.org/jira/browse/DOXIA-727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17808922#comment-17808922 ]
ASF GitHub Bot commented on DOXIA-727: -------------------------------------- kwin commented on code in PR #197: URL: https://github.com/apache/maven-doxia/pull/197#discussion_r1460504261 ########## 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: It says in its javadoc > A more complete and consistent set of LIFO stack operations is provided by the [Deque](https://docs.oracle.com/javase/8/docs/api/java/util/Deque.html) interface and its implementations, which should be used in preference to this class. > MarkdownSink: Incorrect escaping inside code spans > -------------------------------------------------- > > Key: DOXIA-727 > URL: https://issues.apache.org/jira/browse/DOXIA-727 > Project: Maven Doxia > Issue Type: Bug > Components: Module - Markdown > Reporter: Konrad Windszus > Assignee: Konrad Windszus > Priority: Major > > According to https://spec.commonmark.org/0.30/#backslash-escapes > bq. Backslash escapes do not work in code blocks, code spans, autolinks, or > raw HTML > Currently the escaping is not disabled between {{Sink.inline(...)}} and > {{Sink.inline(...)}} with "code" semantics (also used from > {{Sink.monospaced()}}) (emits a code span) but only in between > {{Sink.verbatim()}} and {{Sink.verbatim()_}} (emits a code block). > autolinks and raw HTML are currently either never emitted or don't use > escaping -- This message was sent by Atlassian Jira (v8.20.10#820010)