diff --git a/pom.xml b/pom.xml index 1b493418..fd149405 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.nbclaudecodegui netbeans-claude-code-gui - 0.23.6-SNAPSHOT + 0.23.10-SNAPSHOT nbm Netbeans Plugin Claude Code GUI NetBeans plugin that provides a GUI for Claude Code CLI — run claude code sessions directly inside the IDE. diff --git a/src/main/java/io/github/nbclaudecodegui/ui/common/MarkdownRenderer.java b/src/main/java/io/github/nbclaudecodegui/ui/common/MarkdownRenderer.java index 17e2906d..b9b87495 100644 --- a/src/main/java/io/github/nbclaudecodegui/ui/common/MarkdownRenderer.java +++ b/src/main/java/io/github/nbclaudecodegui/ui/common/MarkdownRenderer.java @@ -226,29 +226,50 @@ public static void appendInfo(JEditorPane pane, String line) { */ public static String toHtml(String markdown) { StringBuilder html = new StringBuilder(); - // Split on fenced code blocks; odd-indexed segments are code content. String[] parts = markdown.split("```[^\\n]*\\n", -1); boolean continueList = false; + List savedTypeStack = null; + List savedIndentStack = null; + int savedOwnerIndent = -1; for (int i = 0; i < parts.length; i++) { if (i % 2 == 0) { - // regular text segment - // strip trailing ``` from previous code block end String seg = parts[i]; if (i > 0 && seg.startsWith("```")) { seg = seg.substring(3); } - String converted = convertSegment(seg); if (continueList) { - // strip the new
    ...
wrapper and continue inside the open list - converted = converted.replaceFirst("^
    ", "") - .replaceFirst("
$", ""); + String[] contLines = seg.split("\n", -1); + // Skip only blank lines to find the first non-blank content. + int firstIdx = 0; + while (firstIdx < contLines.length && contLines[firstIdx].isBlank()) { + firstIdx++; + } + int subListEnd = firstIdx; + if (firstIdx < contLines.length + && leadingSpaces(contLines[firstIdx]) > savedOwnerIndent) { + // Sub-items belong inside the currently open
  • — render them there. + subListEnd = renderNestedList(contLines, firstIdx, html); + } + // Close the owner item now that its content (code block + any sub-list) is done. + html.append("
  • "); + // Render remaining lines using the saved outer context so that items at + // different indent levels (siblings vs. outer) are placed correctly. + int listEnd = renderNestedList(contLines, subListEnd, html, + new ArrayList<>(savedIndentStack), new ArrayList<>(savedTypeStack)); continueList = false; - html.append(converted).append(""); + savedTypeStack = null; + savedIndentStack = null; + savedOwnerIndent = -1; + // Process any content after the list (headings, paragraphs, next list prefix). + if (listEnd < contLines.length) { + String tail = String.join("\n", + Arrays.copyOfRange(contLines, listEnd, contLines.length)); + html.append(convertSegment(tail)); + } } else { - html.append(converted); + html.append(convertSegment(seg)); } } else { - // code block content String code = parts[i]; if (code.endsWith("```")) { code = code.substring(0, code.length() - 3); @@ -256,18 +277,38 @@ public static String toHtml(String markdown) { code = code.stripTrailing(); code = dedent(code); String preHtml = "
    " + esc(code) + "
    "; - // An indented fence (spaces before ```) means the code block belongs to a list item boolean indented = i > 0 && parts[i - 1].matches("(?s).*[ \t]+$"); if (indented) { - // Remove the list closure emitted by the previous segment, then - // embed the code block inside the last
  • before re-closing it. - if (html.toString().endsWith("")) { + // Reconstruct the active list context by scanning all text segments up to here. + savedIndentStack = new ArrayList<>(); + savedTypeStack = new ArrayList<>(); + for (int k = 0; k < i; k += 2) { + for (String pl : parts[k].split("\n", -1)) { + if (!isOrdered(pl) && !isUnordered(pl)) continue; + int indent = leadingSpaces(pl); + boolean isOl = isOrdered(pl); + while (!savedIndentStack.isEmpty() + && savedIndentStack.get(savedIndentStack.size() - 1) >= indent) { + savedIndentStack.remove(savedIndentStack.size() - 1); + savedTypeStack.remove(savedTypeStack.size() - 1); + } + savedIndentStack.add(indent); + savedTypeStack.add(isOl); + } + } + savedOwnerIndent = savedIndentStack.isEmpty() ? -1 + : savedIndentStack.get(savedIndentStack.size() - 1); + // Remove ALL trailing list-close tags and the owner item's
  • from html. + String buf = html.toString(); + while (buf.endsWith("") || buf.endsWith("")) { html.delete(html.length() - 5, html.length()); + buf = html.toString(); } - if (html.toString().endsWith("")) { + if (buf.endsWith("")) { html.delete(html.length() - 5, html.length()); } - html.append(preHtml).append(""); + // Append code block but leave the owner
  • open for sub-list content. + html.append(preHtml); continueList = true; } else { html.append(preHtml); @@ -275,7 +316,11 @@ public static String toHtml(String markdown) { } } if (continueList) { - html.append(""); + // Code block was the last content — close owner item then close all open lists. + html.append("
  • "); + for (int k = savedTypeStack.size() - 1; k >= 0; k--) { + html.append(savedTypeStack.get(k) ? "" : ""); + } } return html.toString(); } @@ -538,8 +583,12 @@ private static void appendHtml(JEditorPane pane, String html) { } private static int renderNestedList(String[] lines, int start, StringBuilder html) { - List indentStack = new ArrayList<>(); - List typeStack = new ArrayList<>(); + return renderNestedList(lines, start, html, new ArrayList<>(), new ArrayList<>()); + } + + private static int renderNestedList(String[] lines, int start, StringBuilder html, + List indentStack, List typeStack) { + int startIndent = indentStack.isEmpty() ? -1 : indentStack.get(0); int i = start; while (i < lines.length) { @@ -561,6 +610,7 @@ private static int renderNestedList(String[] lines, int start, StringBuilder htm boolean ordered = isOrdered(line); if (indentStack.isEmpty()) { + startIndent = indent; html.append(ordered ? "
      " : "
        "); indentStack.add(indent); typeStack.add(ordered); @@ -571,11 +621,15 @@ private static int renderNestedList(String[] lines, int start, StringBuilder htm indentStack.add(indent); typeStack.add(ordered); } else if (indent < topIndent) { - while (indentStack.size() > 1 && indentStack.get(indentStack.size() - 1) > indent) { + while (!indentStack.isEmpty() && indentStack.get(indentStack.size() - 1) > indent) { html.append(typeStack.get(typeStack.size() - 1) ? "
    " : ""); indentStack.remove(indentStack.size() - 1); typeStack.remove(typeStack.size() - 1); } + // Item is less indented than our starting level — belongs to outer context. + if (indentStack.isEmpty() || indent < startIndent) { + break; + } } if (!typeStack.isEmpty() && typeStack.get(typeStack.size() - 1) != ordered) { html.append(typeStack.get(typeStack.size() - 1) ? "" : ""); @@ -585,8 +639,21 @@ private static int renderNestedList(String[] lines, int start, StringBuilder htm } String content = line.replaceFirst("^\\s*(?:\\d+\\.|[-*])\\s+", ""); - html.append("
  • ").append(inlineToHtml(content)).append("
  • "); + html.append("
  • ").append(inlineToHtml(content)); i++; + // Lookahead: include non-list lines more indented than topIndent as continuation content. + int curTopIndent = indentStack.get(indentStack.size() - 1); + int j = i; + while (j < lines.length && lines[j].isBlank()) j++; + while (j < lines.length && !lines[j].isBlank() + && !isOrdered(lines[j]) && !isUnordered(lines[j]) + && leadingSpaces(lines[j]) > curTopIndent) { + html.append(inlineToHtml(lines[j].trim())); + j++; + while (j < lines.length && lines[j].isBlank()) j++; + } + i = j; + html.append("
  • "); } for (int k = typeStack.size() - 1; k >= 0; k--) { diff --git a/src/test/java/io/github/nbclaudecodegui/ui/common/MarkdownRendererTest.java b/src/test/java/io/github/nbclaudecodegui/ui/common/MarkdownRendererTest.java index 84d8772b..94f51dd4 100644 --- a/src/test/java/io/github/nbclaudecodegui/ui/common/MarkdownRendererTest.java +++ b/src/test/java/io/github/nbclaudecodegui/ui/common/MarkdownRendererTest.java @@ -1,13 +1,58 @@ package io.github.nbclaudecodegui.ui.common; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.File; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.*; /** - * Unit tests for {@link MarkdownRenderer}'s markdown-to-HTML conversion. + * Unit tests for {@link MarkdownRenderer}. + * + *

    toHtml() tests are fixture-based: each case is a pair of resource files under + * {@code io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/}: + *

      + *
    • {@code .src.md} — input markdown
    • + *
    • {@code .expectedHtml.html} — expected HTML output
    • + *
    */ class MarkdownRendererTest { + private static final String TO_HTML_RESOURCE_DIR = + "io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html"; + + static Stream toHtmlTestCases() throws Exception { + URL dirUrl = MarkdownRendererTest.class.getClassLoader().getResource(TO_HTML_RESOURCE_DIR); + assertNotNull(dirUrl, "Resource directory not found: " + TO_HTML_RESOURCE_DIR); + File dir = new File(dirUrl.toURI()); + List cases = new ArrayList<>(); + File[] srcFiles = dir.listFiles((d, name) -> name.endsWith(".src.md")); + assertNotNull(srcFiles); + for (File src : srcFiles) { + String caseName = src.getName().replace(".src.md", ""); + Path expectedPath = src.toPath().resolveSibling(caseName + ".expectedHtml.html"); + cases.add(new Object[]{caseName, src.toPath(), expectedPath}); + } + return cases.stream(); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("toHtmlTestCases") + void toHtml(String caseName, Path srcFile, Path expectedFile) throws Exception { + String src = Files.readString(srcFile); + String expected = Files.readString(expectedFile).strip(); + assertEquals(expected, MarkdownRenderer.toHtml(src).strip(), + "HTML mismatch for case '" + caseName + "'"); + } + // ------------------------------------------------------------------------- // esc() // ------------------------------------------------------------------------- @@ -64,118 +109,6 @@ void testPlainTextEscaped() { assertEquals("a & b <c>", MarkdownRenderer.inlineToHtml("a & b ")); } - // ------------------------------------------------------------------------- - // toHtml() — block elements - // ------------------------------------------------------------------------- - - @Test - void testHeadings() { - String html = MarkdownRenderer.toHtml("# H1\n## H2\n### H3"); - assertTrue(html.contains("

    ") && html.contains("H1") && html.contains("

    "), "h1"); - assertTrue(html.contains("

    ") && html.contains("H2") && html.contains("

    "), "h2"); - assertTrue(html.contains("

    ") && html.contains("H3") && html.contains("

    "), "h3"); - } - - @Test - void testUnorderedList() { - String html = MarkdownRenderer.toHtml("- alpha\n- beta\n- gamma"); - assertTrue(html.contains("
      "), "ul open"); - assertTrue(html.contains("
    "), "ul close"); - assertTrue(html.contains("
  • alpha
  • "), "item alpha"); - assertTrue(html.contains("
  • beta
  • "), "item beta"); - assertTrue(html.contains("
  • gamma
  • "), "item gamma"); - } - - @Test - void testOrderedList() { - String html = MarkdownRenderer.toHtml("1. first\n2. second"); - assertTrue(html.contains("
      "), "ol open"); - assertTrue(html.contains("
    1. first
    2. "), "item first"); - assertTrue(html.contains("
    3. second
    4. "), "item second"); - } - - @Test - void testBlockquote() { - String html = MarkdownRenderer.toHtml("> some quote\n> continued"); - assertTrue(html.contains("
      "), "blockquote open"); - assertTrue(html.contains("some quote"), "content line 1"); - assertTrue(html.contains("continued"), "content line 2"); - } - - @Test - void testFencedCodeBlock() { - String html = MarkdownRenderer.toHtml("```java\nSystem.out.println();\n```"); - assertTrue(html.contains("
      "), "pre open");
      -        assertTrue(html.contains("System.out.println();"), "code content");
      -    }
      -
      -    @Test
      -    void testCodeBlockHtmlEscaped() {
      -        String html = MarkdownRenderer.toHtml("```\na < b && c > d\n```");
      -        assertTrue(html.contains("<"), "< escaped");
      -        assertTrue(html.contains("&"), "& escaped");
      -    }
      -
      -    @Test
      -    void testParagraph() {
      -        String html = MarkdownRenderer.toHtml("Hello world");
      -        assertTrue(html.contains("

      "), "paragraph"); - assertTrue(html.contains("Hello world"), "content"); - } - - // ------------------------------------------------------------------------- - // toHtml() — tables - // ------------------------------------------------------------------------- - - @Test - void testBasicTable() { - String md = "| Name | Age |\n|------|-----|\n| Alice | 30 |\n| Bob | 25 |"; - String html = MarkdownRenderer.toHtml(md); - - assertTrue(html.contains(""), "table open"); - assertTrue(html.contains("
      "), "table close"); - assertTrue(html.contains(""), "th present"); - assertTrue(html.contains(""), "td present"); - assertTrue(html.contains("Name"), "header Name"); - assertTrue(html.contains("Age"), "header Age"); - assertTrue(html.contains("Alice"), "cell Alice"); - assertTrue(html.contains("Bob"), "cell Bob"); - assertTrue(html.contains("30"), "cell 30"); - assertTrue(html.contains("25"), "cell 25"); - } - - @Test - void testTableHeaderRow() { - String md = "| Col1 | Col2 | Col3 |\n|------|------|------|\n| a | b | c |"; - String html = MarkdownRenderer.toHtml(md); - - // Header cells must be , data cells must be - assertTrue(html.indexOf("") < html.indexOf(""), - "th should come before td"); - assertTrue(html.contains("Col1"), "th Col1"); - assertTrue(html.contains("a"), "td a"); - } - - @Test - void testTableWithInlineMarkdown() { - String md = "| **Bold** | `code` |\n|----------|--------|\n| value | val2 |"; - String html = MarkdownRenderer.toHtml(md); - assertTrue(html.contains("Bold"), "bold in header"); - assertTrue(html.contains("code"), "code in header"); - } - - @Test - void testTableHtmlEscapedCells() { - String md = "| A"), "link in paragraph"); - assertTrue(html.contains("Installation & Build"), "link text"); - assertFalse(html.contains("[Installation"), "raw markdown should not appear"); - } - @Test void testInlineLinkMixedWithBold() { String result = MarkdownRenderer.inlineToHtml("See [guide](readme.md) and **bold**"); @@ -201,18 +125,6 @@ void testInlineLinkMixedWithBold() { assertTrue(result.contains("bold"), "bold"); } - @Test - void testTableFollowedByParagraph() { - String md = "| X |\n|---|\n| v |\n\nSome text after."; - String html = MarkdownRenderer.toHtml(md); - assertTrue(html.contains(""), "table present"); - assertTrue(html.contains("Some text after"), "paragraph after table"); - } - - // ------------------------------------------------------------------------- - // Bug 2: Images - // ------------------------------------------------------------------------- - @Test void testInlineImage() { String result = MarkdownRenderer.inlineToHtml("![alt text](image.png)"); @@ -222,13 +134,6 @@ void testInlineImage() { assertFalse(result.contains("!["), "raw markdown should not appear"); } - @Test - void testInlineImageInParagraph() { - String html = MarkdownRenderer.toHtml("Here is an image: ![logo](logo.png)"); - assertTrue(html.contains(""), "h1 named anchor"); - assertTrue(html.contains("

      "), "h1 tag"); - } - - @Test - void testHeadingH2HasNamedAnchor() { - String html = MarkdownRenderer.toHtml("## Section Two"); - assertTrue(html.contains(""), "h2 named anchor"); - } - - @Test - void testHeadingH3HasNamedAnchor() { - String html = MarkdownRenderer.toHtml("### Sub Section"); - assertTrue(html.contains(""), "h3 named anchor"); - } - - @Test - void testHeadingSlugStripNonAlphanumeric() { - String html = MarkdownRenderer.toHtml("# Hello, World! (2024)"); - assertTrue(html.contains(""), "slug strips punctuation"); - } - - // ------------------------------------------------------------------------- - // toHtml() — nested lists - // ------------------------------------------------------------------------- - - @Test - void testNestedOrderedList() { - String md = "1. first\n 1. sub-first\n 2. sub-second\n2. second"; - String html = MarkdownRenderer.toHtml(md); - // outer ol must contain an inner ol - int outerOl = html.indexOf("
        must exist inside outer
          "); - assertTrue(html.contains("
        1. first
        2. ") || html.contains("
        3. first"), - "outer first item"); - assertTrue(html.contains("sub-first"), "sub-first item"); - assertTrue(html.contains("sub-second"), "sub-second item"); - assertTrue(html.contains("second"), "outer second item"); - // must have at least 2
        closing tags - long closeCount = html.chars().filter(c -> c == '<').count(); - assertTrue(html.indexOf("
      ", html.indexOf("") + 1) > 0, - "at least 2 tags expected"); - } - - @Test - void testNestedUnorderedList() { - String md = "- alpha\n - sub-alpha\n - sub-beta\n- beta"; - String html = MarkdownRenderer.toHtml(md); - int outerUl = html.indexOf("

      NameAge
      Alice30
      Bob25
      \ No newline at end of file diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-basic.src.md b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-basic.src.md new file mode 100644 index 00000000..0247d5ca --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-basic.src.md @@ -0,0 +1,4 @@ +| Name | Age | +|------|-----| +| Alice | 30 | +| Bob | 25 | diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-followed-by-paragraph.expectedHtml.html b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-followed-by-paragraph.expectedHtml.html new file mode 100644 index 00000000..6fcd6fff --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-followed-by-paragraph.expectedHtml.html @@ -0,0 +1 @@ +
      X
      v

      Some text after.

      \ No newline at end of file diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-followed-by-paragraph.src.md b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-followed-by-paragraph.src.md new file mode 100644 index 00000000..d878538b --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-followed-by-paragraph.src.md @@ -0,0 +1,5 @@ +| X | +|---| +| v | + +Some text after. diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-html-escaped.expectedHtml.html b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-html-escaped.expectedHtml.html new file mode 100644 index 00000000..0508f1d5 --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-html-escaped.expectedHtml.html @@ -0,0 +1 @@ +
      A<BC&D
      xy
      \ No newline at end of file diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-html-escaped.src.md b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-html-escaped.src.md new file mode 100644 index 00000000..b33d39d7 --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-html-escaped.src.md @@ -0,0 +1,3 @@ +| ABoldcodevalueval2 \ No newline at end of file diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-inline-markdown.src.md b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-inline-markdown.src.md new file mode 100644 index 00000000..5823e451 --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/table-inline-markdown.src.md @@ -0,0 +1,3 @@ +| **Bold** | `code` | +|----------|--------| +| value | val2 | diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-code-block-resets-numbering.expectedHtml.html b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-code-block-resets-numbering.expectedHtml.html new file mode 100644 index 00000000..5cc49a5f --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-code-block-resets-numbering.expectedHtml.html @@ -0,0 +1 @@ +
      1. Item A
      top level
      1. New list
      \ No newline at end of file diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-code-block-resets-numbering.src.md b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-code-block-resets-numbering.src.md new file mode 100644 index 00000000..44132cd9 --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-code-block-resets-numbering.src.md @@ -0,0 +1,7 @@ +1. Item A + +``` +top level +``` + +1. New list diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-list-code-block-after-heading.expectedHtml.html b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-list-code-block-after-heading.expectedHtml.html new file mode 100644 index 00000000..6a5d7b6f --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-list-code-block-after-heading.expectedHtml.html @@ -0,0 +1 @@ +
      1. A
        B

      F

      1. G
      \ No newline at end of file diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-list-code-block-after-heading.src.md b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-list-code-block-after-heading.src.md new file mode 100644 index 00000000..93833625 --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/top-level-list-code-block-after-heading.src.md @@ -0,0 +1,11 @@ +1. A + + ```bash + B + ``` + +## F + +1. ```bash + G + ``` diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-code-block-not-split.expectedHtml.html b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-code-block-not-split.expectedHtml.html new file mode 100644 index 00000000..d4e62974 --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-code-block-not-split.expectedHtml.html @@ -0,0 +1 @@ +
      • Item one
        echo hi
      • Item two
      \ No newline at end of file diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-code-block-not-split.src.md b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-code-block-not-split.src.md new file mode 100644 index 00000000..3f6c469c --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-code-block-not-split.src.md @@ -0,0 +1,7 @@ +- Item one + + ```bash + echo hi + ``` + +- Item two diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-nested.expectedHtml.html b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-nested.expectedHtml.html new file mode 100644 index 00000000..df5dea3c --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-nested.expectedHtml.html @@ -0,0 +1 @@ +
      • alpha
        • sub-alpha
        • sub-beta
      • beta
      \ No newline at end of file diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-nested.src.md b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-nested.src.md new file mode 100644 index 00000000..2c41e80d --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-nested.src.md @@ -0,0 +1,4 @@ +- alpha + - sub-alpha + - sub-beta +- beta diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-simple.expectedHtml.html b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-simple.expectedHtml.html new file mode 100644 index 00000000..04c49dd5 --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-simple.expectedHtml.html @@ -0,0 +1 @@ +
      • alpha
      • beta
      • gamma
      \ No newline at end of file diff --git a/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-simple.src.md b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-simple.src.md new file mode 100644 index 00000000..d42aa2b4 --- /dev/null +++ b/src/test/resources/io/github/nbclaudecodegui/ui/common/markdown-renderer/to-html/unordered-list-simple.src.md @@ -0,0 +1,3 @@ +- alpha +- beta +- gamma