diff options
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java | 19 |
1 files changed, 18 insertions, 1 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 a2a3efb5..1b55eb6c 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java @@ -98,7 +98,6 @@ public class RichTextJSONConverter implements Visitor { } richText.put(DOCUMENT, document); - return richText; } @@ -138,7 +137,25 @@ public class RichTextJSONConverter implements Visitor { @Override public void visit(BlockQuote blockQuote) { + try { + JSONObject nodeJSON = new JSONObject(); + nodeJSON.put(TYPE, BLOCKQUOTE_E); + + contentArrayStack.push(new JSONArray()); + Node child = blockQuote.getFirstChild(); + while (child != null) { + child.accept(this); + child = child.getNext(); + } + + JSONArray cArray = contentArrayStack.pop(); + + nodeJSON.put(CONTENT, cArray); + contentArrayStack.peek().put(nodeJSON); + } catch (JSONException e) { + throw new RuntimeException(e); + } } @Override |