From f9b57b27425e8a936ec5a7b6a16b19d37d76ec1f Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Fri, 29 Dec 2023 19:41:06 +0100 Subject: [PATCH] [DOXIA-715] Consider attributes for text(...) in AptSink and MarkdownSink --- .../java/org/apache/maven/doxia/module/apt/AptSink.java | 6 ++++++ .../apache/maven/doxia/module/markdown/MarkdownSink.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java index 29480b8a4..58a2a0ec9 100644 --- a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java +++ b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java @@ -808,6 +808,9 @@ public void nonBreakingSpace() { @Override public void text(String text, SinkEventAttributes attributes) { + if (attributes != null) { + inline(attributes); + } if (tableCaptionFlag) { tableCaptionBuffer.append(text); } else if (headerFlag || bufferFlag) { @@ -817,6 +820,9 @@ public void text(String text, SinkEventAttributes attributes) { } else { content(text); } + if (attributes != null) { + inline_(); + } } /** {@inheritDoc} */ diff --git a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownSink.java b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownSink.java index 68ef34ffa..cca67d4f9 100644 --- a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownSink.java +++ b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownSink.java @@ -686,6 +686,9 @@ public void nonBreakingSpace() { @Override public void text(String text, SinkEventAttributes attributes) { + if (attributes != null) { + inline(attributes); + } if (tableCaptionFlag) { tableCaptionBuffer.append(text); } else if (headerFlag || bufferFlag) { @@ -695,6 +698,9 @@ public void text(String text, SinkEventAttributes attributes) { } else { content(text); } + if (attributes != null) { + inline_(); + } } @Override