diff options
author | scria1000 <91804886+scria1000@users.noreply.github.com> | 2021-11-25 18:54:08 +0000 |
---|---|---|
committer | scria1000 <91804886+scria1000@users.noreply.github.com> | 2021-11-25 18:54:08 +0000 |
commit | 209a874f57f37fd7b32daa5df2c8951df0c940f4 (patch) | |
tree | b0bc69fae6118d6cad9d95e0d5f130f2244cbe05 | |
parent | 8423a1807162268d3f4b47b9ca7f5d4280b255ce (diff) | |
download | infinity-for-reddit-209a874f57f37fd7b32daa5df2c8951df0c940f4.tar infinity-for-reddit-209a874f57f37fd7b32daa5df2c8951df0c940f4.tar.gz infinity-for-reddit-209a874f57f37fd7b32daa5df2c8951df0c940f4.tar.bz2 infinity-for-reddit-209a874f57f37fd7b32daa5df2c8951df0c940f4.tar.lz infinity-for-reddit-209a874f57f37fd7b32daa5df2c8951df0c940f4.tar.xz infinity-for-reddit-209a874f57f37fd7b32daa5df2c8951df0c940f4.tar.zst infinity-for-reddit-209a874f57f37fd7b32daa5df2c8951df0c940f4.zip |
Minor tweaks
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/markdown/SpoilerParserPlugin.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/SpoilerParserPlugin.java b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/SpoilerParserPlugin.java index bd926f7c..1cca0cfe 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/SpoilerParserPlugin.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/SpoilerParserPlugin.java @@ -83,7 +83,7 @@ public class SpoilerParserPlugin extends AbstractMarkwonPlugin { for (CodeSpan codeSpan : codeSpans) { int spanBeginning = markdownStringBuilder.getSpanStart(codeSpan); int spanEnd = markdownStringBuilder.getSpanEnd(codeSpan); - if (spoilerStart < spanBeginning && spanEnd < spoilerEnd) { + if (spoilerStart + 2 <= spanBeginning && spanEnd <= spoilerEnd + 2) { markdownStringBuilder.delete(spoilerStart, spoilerStart + 2); markdownStringBuilder.delete(spoilerEnd, spoilerEnd + 2); SpoilerSpan spoilerSpan = new SpoilerSpan(textColor, backgroundColor); @@ -97,7 +97,7 @@ public class SpoilerParserPlugin extends AbstractMarkwonPlugin { for (CodeBlockSpan codeBlockSpan : codeBlockSpans) { int spanBeginning = markdownStringBuilder.getSpanStart(codeBlockSpan); int spanEnd = markdownStringBuilder.getSpanEnd(codeBlockSpan); - if (spoilerStart < spanBeginning && spanEnd < spoilerEnd) { + if (spoilerStart + 2 <= spanBeginning && spanEnd <= spoilerEnd + 2) { markdownStringBuilder.delete(spoilerStart, spoilerStart + 2); markdownStringBuilder.delete(spoilerEnd, spoilerEnd + 2); SpoilerSpan spoilerSpan = new SpoilerSpan(textColor, backgroundColor); |