From 0ec8584c9e8d99c7179a201231ae7a0419c950b8 Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Sat, 28 Nov 2020 12:49:13 +0100 Subject: [PATCH 1/6] Move EditHandlers to editor package --- .../editor/EditorMultipleEditSpansSample.java | 1 + .../handler}/BlockQuoteEditHandler.java | 0 .../editor/handler/CodeBlockEditHandler.java | 47 +++++++++++++++++++ .../editor/handler}/CodeEditHandler.java | 0 .../editor/handler}/HeadingEditHandler.java | 0 .../handler}/StrikethroughEditHandler.java | 0 6 files changed, 48 insertions(+) rename {app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared => markwon-editor/src/main/java/io/noties/markwon/editor/handler}/BlockQuoteEditHandler.java (100%) create mode 100644 markwon-editor/src/main/java/io/noties/markwon/editor/handler/CodeBlockEditHandler.java rename {app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared => markwon-editor/src/main/java/io/noties/markwon/editor/handler}/CodeEditHandler.java (100%) rename {app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared => markwon-editor/src/main/java/io/noties/markwon/editor/handler}/HeadingEditHandler.java (100%) rename {app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared => markwon-editor/src/main/java/io/noties/markwon/editor/handler}/StrikethroughEditHandler.java (100%) diff --git a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorMultipleEditSpansSample.java b/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorMultipleEditSpansSample.java index 91e36ad1..b2ba4f17 100644 --- a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorMultipleEditSpansSample.java +++ b/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorMultipleEditSpansSample.java @@ -76,6 +76,7 @@ public void configureParser(@NonNull Parser.Builder builder) { .useEditHandler(new EmphasisEditHandler()) .useEditHandler(new StrongEmphasisEditHandler()) .useEditHandler(new StrikethroughEditHandler()) + .useEditHandler(new CodeBlockEditHandler()) .useEditHandler(new CodeEditHandler()) .useEditHandler(new BlockQuoteEditHandler()) .useEditHandler(new LinkEditHandler(onClick)) diff --git a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared/BlockQuoteEditHandler.java b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/BlockQuoteEditHandler.java similarity index 100% rename from app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared/BlockQuoteEditHandler.java rename to markwon-editor/src/main/java/io/noties/markwon/editor/handler/BlockQuoteEditHandler.java diff --git a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/CodeBlockEditHandler.java b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/CodeBlockEditHandler.java new file mode 100644 index 00000000..0f94bba4 --- /dev/null +++ b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/CodeBlockEditHandler.java @@ -0,0 +1,47 @@ +package it.niedermann.android.markdown.markwon.handler; + +import android.text.Editable; +import android.text.Spanned; + +import androidx.annotation.NonNull; + +import io.noties.markwon.Markwon; +import io.noties.markwon.core.MarkwonTheme; +import io.noties.markwon.core.spans.CodeBlockSpan; +import io.noties.markwon.editor.EditHandler; +import io.noties.markwon.editor.MarkwonEditorUtils; +import io.noties.markwon.editor.PersistedSpans; + +public class CodeBlockEditHandler implements EditHandler { + private MarkwonTheme theme; + + @Override + public void init(@NonNull Markwon markwon) { + theme = markwon.configuration().theme(); + } + + @Override + public void configurePersistedSpans(@NonNull PersistedSpans.Builder builder) { + builder.persistSpan(CodeBlockSpan.class, () -> new CodeBlockSpan(theme)); + } + + @Override + public void handleMarkdownSpan(@NonNull PersistedSpans persistedSpans, @NonNull Editable editable, @NonNull String input, @NonNull CodeBlockSpan span, int spanStart, int spanTextLength) { + MarkwonEditorUtils.Match delimited = MarkwonEditorUtils.findDelimited(input, spanStart, "```"); + if (delimited != null) { + editable.setSpan( + persistedSpans.get(markdownSpanType()), + delimited.start(), + delimited.end(), + Spanned.SPAN_EXCLUSIVE_EXCLUSIVE + + ); + } + } + + @NonNull + @Override + public Class markdownSpanType() { + return CodeBlockSpan.class; + } +} diff --git a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared/CodeEditHandler.java b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/CodeEditHandler.java similarity index 100% rename from app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared/CodeEditHandler.java rename to markwon-editor/src/main/java/io/noties/markwon/editor/handler/CodeEditHandler.java diff --git a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared/HeadingEditHandler.java b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java similarity index 100% rename from app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared/HeadingEditHandler.java rename to markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java diff --git a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared/StrikethroughEditHandler.java b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/StrikethroughEditHandler.java similarity index 100% rename from app-sample/src/main/java/io/noties/markwon/app/samples/editor/shared/StrikethroughEditHandler.java rename to markwon-editor/src/main/java/io/noties/markwon/editor/handler/StrikethroughEditHandler.java From a46df8fa66358ea9929dfcb30044b9e8b0fa54bc Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Sat, 28 Nov 2020 12:51:33 +0100 Subject: [PATCH 2/6] Improve HeadingEditHandler (WiP) --- .../editor/handler/HeadingEditHandler.java | 125 +++++++++++++----- 1 file changed, 94 insertions(+), 31 deletions(-) diff --git a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java index 990d3995..2af54951 100644 --- a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java +++ b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java @@ -1,7 +1,8 @@ -package io.noties.markwon.app.samples.editor.shared; +package it.niedermann.android.markdown.markwon.handler; import android.text.Editable; import android.text.Spanned; +import android.util.Log; import androidx.annotation.NonNull; @@ -13,6 +14,15 @@ public class HeadingEditHandler implements EditHandler { + private static final String[] MARKERS = new String[]{ + "#", + "##", + "###", + "####", + "#####", + "######", + }; + private MarkwonTheme theme; @Override @@ -22,61 +32,114 @@ public void init(@NonNull Markwon markwon) { @Override public void configurePersistedSpans(@NonNull PersistedSpans.Builder builder) { - builder - .persistSpan(Head1.class, () -> new Head1(theme)) - .persistSpan(Head2.class, () -> new Head2(theme)); + builder.persistSpan(Heading1Span.class, () -> new Heading1Span(theme)); + builder.persistSpan(Heading2Span.class, () -> new Heading2Span(theme)); + builder.persistSpan(Heading3Span.class, () -> new Heading3Span(theme)); + builder.persistSpan(Heading4Span.class, () -> new Heading4Span(theme)); + builder.persistSpan(Heading5Span.class, () -> new Heading5Span(theme)); + builder.persistSpan(Heading6Span.class, () -> new Heading6Span(theme)); } @Override public void handleMarkdownSpan( - @NonNull PersistedSpans persistedSpans, - @NonNull Editable editable, - @NonNull String input, - @NonNull HeadingSpan span, - int spanStart, - int spanTextLength - ) { - final Class type; + @NonNull PersistedSpans persistedSpans, + @NonNull Editable editable, + @NonNull String input, + @NonNull HeadingSpan span, + int spanStart, + int spanTextLength) { + HeadingSpan newSpan; + switch (span.getLevel()) { case 1: - type = Head1.class; + newSpan = persistedSpans.get(Heading1Span.class); break; case 2: - type = Head2.class; + newSpan = persistedSpans.get(Heading2Span.class); + break; + case 3: + newSpan = persistedSpans.get(Heading3Span.class); + break; + case 4: + newSpan = persistedSpans.get(Heading4Span.class); + break; + case 5: + newSpan = persistedSpans.get(Heading5Span.class); + break; + case 6: + newSpan = persistedSpans.get(Heading6Span.class); break; default: - type = null; + return; + } + int newStart = getNewSpanStart(input, spanStart, newSpan.getLevel()); + int newEnd = input.indexOf("\n", newStart); + Log.w("deck", "found heading lv "+span.getLevel()+": \""+input.substring(newStart, newEnd)+"\""); - if (type != null) { - final int index = input.indexOf('\n', spanStart + spanTextLength); - final int end = index < 0 - ? input.length() - : index; - editable.setSpan( - persistedSpans.get(type), - spanStart, - end, - Spanned.SPAN_EXCLUSIVE_EXCLUSIVE - ); + editable.setSpan( + newSpan, + newStart, + newEnd, + Spanned.SPAN_EXCLUSIVE_EXCLUSIVE + ); + } + + private int getNewSpanStart(String input, int spanStart, int level) { + String marker = MARKERS[level-1]; + if (input.substring(spanStart, spanStart + level).equals(marker)) { + return spanStart; + } + + int start = spanStart; + + while (start >= 0 && input.charAt(start) != '\n') { + start--; } + start += 1; + return start; } + @NonNull @Override public Class markdownSpanType() { return HeadingSpan.class; } - private static class Head1 extends HeadingSpan { - Head1(@NonNull MarkwonTheme theme) { + private static class Heading1Span extends HeadingSpan { + public Heading1Span(@NonNull MarkwonTheme theme) { super(theme, 1); } } - private static class Head2 extends HeadingSpan { - Head2(@NonNull MarkwonTheme theme) { + private static class Heading2Span extends HeadingSpan { + public Heading2Span(@NonNull MarkwonTheme theme) { super(theme, 2); } } -} + + private static class Heading3Span extends HeadingSpan { + public Heading3Span(@NonNull MarkwonTheme theme) { + super(theme, 3); + } + } + + private static class Heading4Span extends HeadingSpan { + public Heading4Span(@NonNull MarkwonTheme theme) { + super(theme, 4); + } + } + + private static class Heading5Span extends HeadingSpan { + public Heading5Span(@NonNull MarkwonTheme theme) { + super(theme, 5); + } + } + + private static class Heading6Span extends HeadingSpan { + public Heading6Span(@NonNull MarkwonTheme theme) { + super(theme, 6); + } + } +} \ No newline at end of file From 36977c9a869cb6041baf9a2f918b69bd788bbe81 Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Sun, 29 Nov 2020 10:49:54 +0100 Subject: [PATCH 3/6] Use Runnable instances instead of Lambda expressions for Java < 8 compatibility --- .../editor/handler/HeadingEditHandler.java | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java index 2af54951..7ca4ab0e 100644 --- a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java +++ b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java @@ -2,7 +2,6 @@ import android.text.Editable; import android.text.Spanned; -import android.util.Log; import androidx.annotation.NonNull; @@ -14,14 +13,6 @@ public class HeadingEditHandler implements EditHandler { - private static final String[] MARKERS = new String[]{ - "#", - "##", - "###", - "####", - "#####", - "######", - }; private MarkwonTheme theme; @@ -32,12 +23,12 @@ public void init(@NonNull Markwon markwon) { @Override public void configurePersistedSpans(@NonNull PersistedSpans.Builder builder) { - builder.persistSpan(Heading1Span.class, () -> new Heading1Span(theme)); - builder.persistSpan(Heading2Span.class, () -> new Heading2Span(theme)); - builder.persistSpan(Heading3Span.class, () -> new Heading3Span(theme)); - builder.persistSpan(Heading4Span.class, () -> new Heading4Span(theme)); - builder.persistSpan(Heading5Span.class, () -> new Heading5Span(theme)); - builder.persistSpan(Heading6Span.class, () -> new Heading6Span(theme)); + builder.persistSpan(Heading1Span.class, new Runnable() { new Heading1Span(theme)}); + builder.persistSpan(Heading2Span.class, new Runnable() { new Heading2Span(theme)}); + builder.persistSpan(Heading3Span.class, new Runnable() { new Heading3Span(theme)}); + builder.persistSpan(Heading4Span.class, new Runnable() { new Heading4Span(theme)}); + builder.persistSpan(Heading5Span.class, new Runnable() { new Heading5Span(theme)}); + builder.persistSpan(Heading6Span.class, new Runnable() { new Heading6Span(theme)}); } @Override @@ -73,9 +64,8 @@ public void handleMarkdownSpan( return; } - int newStart = getNewSpanStart(input, spanStart, newSpan.getLevel()); - int newEnd = input.indexOf("\n", newStart); - Log.w("deck", "found heading lv "+span.getLevel()+": \""+input.substring(newStart, newEnd)+"\""); + int newStart = getNewSpanStart(input, spanStart); + int newEnd = findEnd(input, newStart, newSpan.getLevel()); editable.setSpan( newSpan, @@ -85,11 +75,19 @@ public void handleMarkdownSpan( ); } - private int getNewSpanStart(String input, int spanStart, int level) { - String marker = MARKERS[level-1]; - if (input.substring(spanStart, spanStart + level).equals(marker)) { - return spanStart; + private int findEnd(String input, int searchFrom, int spanLevel) { + int end = searchFrom + spanLevel; + int strLength = input.length(); + while (end < strLength-1) { + end++; + if (input.charAt(end) == '\n') { + break; + } } + return end+1; + } + + private int getNewSpanStart(String input, int spanStart) { int start = spanStart; From 7cc74d7b22df7aefa971846348679d0805987721 Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Sun, 29 Nov 2020 10:53:13 +0100 Subject: [PATCH 4/6] Fix syntax error --- .../markwon/editor/handler/HeadingEditHandler.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java index 7ca4ab0e..70652bbc 100644 --- a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java +++ b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java @@ -23,12 +23,12 @@ public void init(@NonNull Markwon markwon) { @Override public void configurePersistedSpans(@NonNull PersistedSpans.Builder builder) { - builder.persistSpan(Heading1Span.class, new Runnable() { new Heading1Span(theme)}); - builder.persistSpan(Heading2Span.class, new Runnable() { new Heading2Span(theme)}); - builder.persistSpan(Heading3Span.class, new Runnable() { new Heading3Span(theme)}); - builder.persistSpan(Heading4Span.class, new Runnable() { new Heading4Span(theme)}); - builder.persistSpan(Heading5Span.class, new Runnable() { new Heading5Span(theme)}); - builder.persistSpan(Heading6Span.class, new Runnable() { new Heading6Span(theme)}); + builder.persistSpan(Heading1Span.class, new Runnable() { new Heading1Span(theme);}); + builder.persistSpan(Heading2Span.class, new Runnable() { new Heading2Span(theme);}); + builder.persistSpan(Heading3Span.class, new Runnable() { new Heading3Span(theme);}); + builder.persistSpan(Heading4Span.class, new Runnable() { new Heading4Span(theme);}); + builder.persistSpan(Heading5Span.class, new Runnable() { new Heading5Span(theme);}); + builder.persistSpan(Heading6Span.class, new Runnable() { new Heading6Span(theme);}); } @Override From 51818a014a7b424ee675e30746caba59ce081d19 Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Sun, 27 Dec 2020 12:56:48 +0100 Subject: [PATCH 5/6] Update imports from sample and make use of Java 8 --- .../samples/editor/EditorHeadingSample.java | 2 +- .../samples/editor/WYSIWYGEditorSample.java | 2 +- markwon-editor/build.gradle | 5 ++++ .../editor/handler/HeadingEditHandler.java | 29 +++++++++---------- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorHeadingSample.java b/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorHeadingSample.java index 915343f5..492d6a80 100644 --- a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorHeadingSample.java +++ b/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorHeadingSample.java @@ -5,7 +5,7 @@ import io.noties.markwon.Markwon; import io.noties.markwon.app.sample.Tags; import io.noties.markwon.app.samples.editor.shared.MarkwonEditTextSample; -import io.noties.markwon.app.samples.editor.shared.HeadingEditHandler; +import io.noties.markwon.editor.handler.HeadingEditHandler; import io.noties.markwon.editor.MarkwonEditor; import io.noties.markwon.editor.MarkwonEditorTextWatcher; import io.noties.markwon.sample.annotations.MarkwonArtifact; diff --git a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/WYSIWYGEditorSample.java b/app-sample/src/main/java/io/noties/markwon/app/samples/editor/WYSIWYGEditorSample.java index 01f916d8..0c36c870 100644 --- a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/WYSIWYGEditorSample.java +++ b/app-sample/src/main/java/io/noties/markwon/app/samples/editor/WYSIWYGEditorSample.java @@ -15,7 +15,6 @@ import io.noties.markwon.app.sample.Tags; import io.noties.markwon.app.samples.editor.shared.BlockQuoteEditHandler; import io.noties.markwon.app.samples.editor.shared.CodeEditHandler; -import io.noties.markwon.app.samples.editor.shared.HeadingEditHandler; import io.noties.markwon.app.samples.editor.shared.LinkEditHandler; import io.noties.markwon.app.samples.editor.shared.MarkwonEditTextSample; import io.noties.markwon.app.samples.editor.shared.StrikethroughEditHandler; @@ -23,6 +22,7 @@ import io.noties.markwon.editor.MarkwonEditorTextWatcher; import io.noties.markwon.editor.PersistedSpans; import io.noties.markwon.editor.handler.EmphasisEditHandler; +import io.noties.markwon.editor.handler.HeadingEditHandler; import io.noties.markwon.editor.handler.StrongEmphasisEditHandler; import io.noties.markwon.sample.annotations.MarkwonArtifact; import io.noties.markwon.sample.annotations.MarkwonSampleInfo; diff --git a/markwon-editor/build.gradle b/markwon-editor/build.gradle index 884f6fb6..393759ba 100644 --- a/markwon-editor/build.gradle +++ b/markwon-editor/build.gradle @@ -11,6 +11,11 @@ android { versionCode 1 versionName version } + + compileOptions { + targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_1_8 + } } dependencies { diff --git a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java index 70652bbc..ce4b5b25 100644 --- a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java +++ b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/HeadingEditHandler.java @@ -1,4 +1,4 @@ -package it.niedermann.android.markdown.markwon.handler; +package io.noties.markwon.editor.handler; import android.text.Editable; import android.text.Spanned; @@ -13,7 +13,6 @@ public class HeadingEditHandler implements EditHandler { - private MarkwonTheme theme; @Override @@ -23,12 +22,12 @@ public void init(@NonNull Markwon markwon) { @Override public void configurePersistedSpans(@NonNull PersistedSpans.Builder builder) { - builder.persistSpan(Heading1Span.class, new Runnable() { new Heading1Span(theme);}); - builder.persistSpan(Heading2Span.class, new Runnable() { new Heading2Span(theme);}); - builder.persistSpan(Heading3Span.class, new Runnable() { new Heading3Span(theme);}); - builder.persistSpan(Heading4Span.class, new Runnable() { new Heading4Span(theme);}); - builder.persistSpan(Heading5Span.class, new Runnable() { new Heading5Span(theme);}); - builder.persistSpan(Heading6Span.class, new Runnable() { new Heading6Span(theme);}); + builder.persistSpan(Heading1Span.class, () -> new Heading1Span(theme)); + builder.persistSpan(Heading2Span.class, () -> new Heading2Span(theme)); + builder.persistSpan(Heading3Span.class, () -> new Heading3Span(theme)); + builder.persistSpan(Heading4Span.class, () -> new Heading4Span(theme)); + builder.persistSpan(Heading5Span.class, () -> new Heading5Span(theme)); + builder.persistSpan(Heading6Span.class, () -> new Heading6Span(theme)); } @Override @@ -39,7 +38,7 @@ public void handleMarkdownSpan( @NonNull HeadingSpan span, int spanStart, int spanTextLength) { - HeadingSpan newSpan; + final HeadingSpan newSpan; switch (span.getLevel()) { case 1: @@ -64,8 +63,8 @@ public void handleMarkdownSpan( return; } - int newStart = getNewSpanStart(input, spanStart); - int newEnd = findEnd(input, newStart, newSpan.getLevel()); + final int newStart = getNewSpanStart(input, spanStart); + final int newEnd = findEnd(input, newStart, newSpan.getLevel()); editable.setSpan( newSpan, @@ -77,24 +76,24 @@ public void handleMarkdownSpan( private int findEnd(String input, int searchFrom, int spanLevel) { int end = searchFrom + spanLevel; - int strLength = input.length(); - while (end < strLength-1) { + final int strLength = input.length(); + while (end < strLength - 1) { end++; if (input.charAt(end) == '\n') { break; } } - return end+1; + return end + 1; } private int getNewSpanStart(String input, int spanStart) { - int start = spanStart; while (start >= 0 && input.charAt(start) != '\n') { start--; } start += 1; + return start; } From 56944dfd3450bf7d9d51a4c2a675ede0a6cae8ff Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Sun, 27 Dec 2020 13:02:53 +0100 Subject: [PATCH 6/6] Fix package and import of CodeBlockEditHandler --- .../app/samples/editor/EditorMultipleEditSpansSample.java | 1 + .../io/noties/markwon/editor/handler/CodeBlockEditHandler.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorMultipleEditSpansSample.java b/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorMultipleEditSpansSample.java index b2ba4f17..b402c8d4 100644 --- a/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorMultipleEditSpansSample.java +++ b/app-sample/src/main/java/io/noties/markwon/app/samples/editor/EditorMultipleEditSpansSample.java @@ -22,6 +22,7 @@ import io.noties.markwon.editor.MarkwonEditorTextWatcher; import io.noties.markwon.editor.handler.EmphasisEditHandler; import io.noties.markwon.editor.handler.StrongEmphasisEditHandler; +import io.noties.markwon.editor.handler.CodeBlockEditHandler; import io.noties.markwon.ext.strikethrough.StrikethroughPlugin; import io.noties.markwon.inlineparser.BangInlineProcessor; import io.noties.markwon.inlineparser.EntityInlineProcessor; diff --git a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/CodeBlockEditHandler.java b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/CodeBlockEditHandler.java index 0f94bba4..3c88ee5b 100644 --- a/markwon-editor/src/main/java/io/noties/markwon/editor/handler/CodeBlockEditHandler.java +++ b/markwon-editor/src/main/java/io/noties/markwon/editor/handler/CodeBlockEditHandler.java @@ -1,4 +1,4 @@ -package it.niedermann.android.markdown.markwon.handler; +package io.noties.markwon.editor.handler; import android.text.Editable; import android.text.Spanned;