diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2024-03-09 15:55:20 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2024-03-09 15:55:20 +0000 |
commit | 9afcb05eb534595d30791fce21e3b865a4beda8c (patch) | |
tree | 2e5f679450a91d0541dc3b4b18f14004583e27e7 | |
parent | 3ef64e2a170f91617d9e86a866d39b4ba4aa13e9 (diff) | |
download | infinity-for-reddit-9afcb05eb534595d30791fce21e3b865a4beda8c.tar infinity-for-reddit-9afcb05eb534595d30791fce21e3b865a4beda8c.tar.gz infinity-for-reddit-9afcb05eb534595d30791fce21e3b865a4beda8c.tar.bz2 infinity-for-reddit-9afcb05eb534595d30791fce21e3b865a4beda8c.tar.lz infinity-for-reddit-9afcb05eb534595d30791fce21e3b865a4beda8c.tar.xz infinity-for-reddit-9afcb05eb534595d30791fce21e3b865a4beda8c.tar.zst infinity-for-reddit-9afcb05eb534595d30791fce21e3b865a4beda8c.zip |
Inline code richtext_json.
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java index 1b55eb6c..5b9fa29d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java @@ -184,10 +184,13 @@ public class RichTextJSONConverter implements Visitor { @Override public void visit(Code code) { - JSONArray format = getFormatArray(code); - if (format != null) { - formats.add(format); - } + JSONArray format = new JSONArray(); + format.put(INLINE_CODE); + format.put(textSB.length()); + format.put(code.getLiteral().length()); + formats.add(format); + + textSB.append(code.getLiteral()); } @Override |