From 9afcb05eb534595d30791fce21e3b865a4beda8c Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Sat, 9 Mar 2024 10:55:20 -0500 Subject: Inline code richtext_json. --- .../infinityforreddit/markdown/RichTextJSONConverter.java | 11 +++++++---- 1 file 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 -- cgit v1.2.3