From c8ceb6c46760998e9d469ff45a6a447bf2b111b5 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Tue, 5 Jul 2022 20:53:42 +0100 Subject: [PATCH] adding html ordered list example with starting position - showcases the existing bug --- app-sample/samples.json | 13 +++++++ .../html/HtmlOrderedListNumbersSample.java | 35 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 app-sample/src/main/java/io/noties/markwon/app/samples/html/HtmlOrderedListNumbersSample.java diff --git a/app-sample/samples.json b/app-sample/samples.json index 1b4c5275..c5623142 100644 --- a/app-sample/samples.json +++ b/app-sample/samples.json @@ -39,6 +39,19 @@ "image" ] }, + { + "javaClassName": "io.noties.markwon.app.samples.html.HtmlOrderedListNumbersSample", + "id": "20210201140502", + "title": "HTML Ordered list numbers", + "description": "", + "artifacts": [ + "HTML" + ], + "tags": [ + "rendering", + "html" + ] + }, { "javaClassName": "io.noties.markwon.app.samples.html.InspectHtmlTextSample", "id": "20210201140501", diff --git a/app-sample/src/main/java/io/noties/markwon/app/samples/html/HtmlOrderedListNumbersSample.java b/app-sample/src/main/java/io/noties/markwon/app/samples/html/HtmlOrderedListNumbersSample.java new file mode 100644 index 00000000..717d6615 --- /dev/null +++ b/app-sample/src/main/java/io/noties/markwon/app/samples/html/HtmlOrderedListNumbersSample.java @@ -0,0 +1,35 @@ +package io.noties.markwon.app.samples.html; + +import io.noties.markwon.Markwon; +import io.noties.markwon.app.sample.ui.MarkwonTextViewSample; +import io.noties.markwon.html.HtmlPlugin; +import io.noties.markwon.sample.annotations.MarkwonArtifact; +import io.noties.markwon.sample.annotations.MarkwonSampleInfo; +import io.noties.markwon.sample.annotations.Tag; + +@MarkwonSampleInfo( + id = "20210201140502", + title = "HTML Ordered list numbers", + artifacts = MarkwonArtifact.HTML, + tags = {Tag.rendering, Tag.html} +) +public class HtmlOrderedListNumbersSample extends MarkwonTextViewSample { + @Override + public void render() { + final String md = "# HTML Ordered lists\n\n" + + "
    " + + "
  1. July
  2. \n" + + "
  3. August
  4. \n" + + "
  5. September
  6. \n" + + "
  7. October
  8. \n" + + "
  9. November
  10. \n" + + "
  11. December
  12. \n" + + "
\n" + + ""; + + final Markwon markwon = Markwon.builder(context) + .usePlugin(HtmlPlugin.create()) + .build(); + markwon.setMarkdown(textView, md); + } +}