diff --git a/src/main/java/com/elovirta/dita/markdown/renderer/TopicRenderer.java b/src/main/java/com/elovirta/dita/markdown/renderer/TopicRenderer.java index fb5d66c..104640d 100644 --- a/src/main/java/com/elovirta/dita/markdown/renderer/TopicRenderer.java +++ b/src/main/java/com/elovirta/dita/markdown/renderer/TopicRenderer.java @@ -285,7 +285,7 @@ private void render(final AbbreviationBlock node, final NodeRendererContext cont private void render(final AdmonitionBlock node, final NodeRendererContext context, final SaxWriter html) { final String type = node.getInfo().toString(); final AttributesBuilder atts = new AttributesBuilder(NOTE_ATTS); - switch (type) { + switch (type.toLowerCase()) { case "note": case "tip": case "fastpath": @@ -298,7 +298,7 @@ private void render(final AdmonitionBlock node, final NodeRendererContext contex case "danger": case "warning": case "trouble": - atts.add("type", type); + atts.add("type", type.toLowerCase()); break; default: atts.add("type", "other").add("othertype", type); diff --git a/src/main/resources/dita2markdownImpl.xsl b/src/main/resources/dita2markdownImpl.xsl index 265f6b0..9aacea5 100644 --- a/src/main/resources/dita2markdownImpl.xsl +++ b/src/main/resources/dita2markdownImpl.xsl @@ -489,12 +489,14 @@ - - - - - - + + + + + + + +
@@ -514,9 +516,11 @@ - - - + + + + +
diff --git a/src/test/resources/dita/admonition.dita b/src/test/resources/dita/admonition.dita index 8600b18..3a98695 100644 --- a/src/test/resources/dita/admonition.dita +++ b/src/test/resources/dita/admonition.dita @@ -64,6 +64,9 @@

block content

+ +

Uppercase type

+
  1. List item diff --git a/src/test/resources/markdown/admonition.md b/src/test/resources/markdown/admonition.md index b40f5cb..beb5cff 100644 --- a/src/test/resources/markdown/admonition.md +++ b/src/test/resources/markdown/admonition.md @@ -64,6 +64,9 @@ Open by default !!! trouble "" block content +!!! CAUTION + Uppercase type + 1. List item !!! note block content diff --git a/src/test/resources/output/ast/admonition.xml b/src/test/resources/output/ast/admonition.xml index f333803..96e1b1d 100644 --- a/src/test/resources/output/ast/admonition.xml +++ b/src/test/resources/output/ast/admonition.xml @@ -1 +1 @@ -
    Admonition
    Block-Styled Side Content
    qualifier:Optional Titleblock contentblock content
    No-Heading Content
    qualifier:block content
    qualifier:block content
    Collapsible Block-Styled Side Content:Collapsed by default
    qualifier:Optional Titleblock content
    Open by default
    qualifier:Optional Titleblock content
    Note:block content
    Tip:block content
    Fastpath:block content
    Restriction:block content
    Important:block content
    Remember:block content
    Attention:block content
    Caution:
    block content
    Note:block content
    Danger
    block content
    Warning:block content
    Trouble:block content
  2. List item
    Note:block content
\ No newline at end of file +
Admonition
Block-Styled Side Content
qualifier:Optional Titleblock contentblock content
No-Heading Content
qualifier:block content
qualifier:block content
Collapsible Block-Styled Side Content:Collapsed by default
qualifier:Optional Titleblock content
Open by default
qualifier:Optional Titleblock content
Note:block content
Tip:block content
Fastpath:block content
Restriction:block content
Important:block content
Remember:block content
Attention:block content
Caution:
block content
Note:block content
Danger
block content
Warning:block content
Trouble:block content
Caution:
Uppercase type
  • List item
    Note:block content
  • \ No newline at end of file diff --git a/src/test/resources/output/ast/note.xml b/src/test/resources/output/ast/note.xml index f234a3d..21f54fb 100644 --- a/src/test/resources/output/ast/note.xml +++ b/src/test/resources/output/ast/note.xml @@ -1 +1 @@ -
    Note
    Note: Note
    Caution:
    Caution
    Danger
    Danger
    Note: Note
    Note: Notice
    Trouble: Trouble
    Warning: Warning
    \ No newline at end of file +
    Note
    Note: Note
    Caution:
    Caution
    Danger
    Danger
    Note: Note
    Note: Notice
    Trouble: Trouble
    Warning: Warning
    \ No newline at end of file diff --git a/src/test/resources/output/markdown/admonition.md b/src/test/resources/output/markdown/admonition.md index 158354d..63e74f2 100644 --- a/src/test/resources/output/markdown/admonition.md +++ b/src/test/resources/output/markdown/admonition.md @@ -66,7 +66,7 @@ block content block content -Caution: +**Caution:** block content @@ -74,7 +74,7 @@ block content block content -Danger +**Danger** block content @@ -86,6 +86,10 @@ block content block content +**Caution:** + +Uppercase type + 1. List item **Note:** diff --git a/src/test/resources/output/markdown/note.md b/src/test/resources/output/markdown/note.md index 6a75137..0588083 100644 --- a/src/test/resources/output/markdown/note.md +++ b/src/test/resources/output/markdown/note.md @@ -2,11 +2,11 @@ **Note:** Note -Caution: +**Caution:** Caution -Danger +**Danger** Danger