michael-o commented on code in PR #1042:
URL: https://github.com/apache/maven-doxia/pull/1042#discussion_r2900222778


##########
doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownSink.java:
##########
@@ -387,14 +398,31 @@ private void startContext(ElementContext newContext) {
         elementContextStack.add(newContext);
     }
 
+    private String toogleToRootContextWithoutBuffering(boolean dumpBuffer) {
+        final String buffer;
+        if (elementContextStack.element() == 
ElementContext.ROOT_WITH_BUFFERING) {
+            buffer = bufferingStackWriter.getCurrentBuffer().toString();
+            endContext(ElementContext.ROOT_WITH_BUFFERING);
+            if (dumpBuffer) {
+                write(buffer);
+            }
+            startContext(ElementContext.ROOT_WITHOUT_BUFFERING);
+        } else if (elementContextStack.element() != 
ElementContext.ROOT_WITHOUT_BUFFERING) {
+            throw new IllegalStateException("Unexpected context " + 
elementContextStack.element()
+                    + ", expected ROOT_WITH_BUFFERING or 
ROOT_WITHOUT_BUFFERING");
+        } else {
+            buffer = "";

Review Comment:
   Makes sense



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to