HomePhabricator
Diffusion Comm df8776bb2c05

[web/native] nested quotation display limit

Tags
None
Referenced Files
F156835: image.png
Sep 6 2022, 8:18 AM
File Not Attached
F156829: image.png
Sep 6 2022, 8:18 AM
File Not Attached
F156828: image.png
Sep 6 2022, 8:18 AM
File Not Attached
Subscribers
None

Description

[web/native] nested quotation display limit

Summary:
Problem:
A lot of nested quotation cause native app crash and looks confusing on web, more details in task: ENG-1547

Reason
We process all quotation levels which results with too many recursive calls.

Solution
Limit level of recursion calls, for that we will use state object which according to simple-markdown docs is the mutable state threading object, which can be examined or modified.

Previously:

image.png (740×566 px, 22 KB)

Now:

image.png (454×409 px, 16 KB)

Also, to make that change I needed to change the same code in two places, there are mostly different rules for each platform but don't you think it worth moving those which are overlapped to one place, somewhere in /lib/shared? I'll wait for your opinion and if yes I'll create a task on linear.

Test Plan:

  1. Spam with a lot of > and check if native app do not crash anymore.
  2. Check if nested quotes are parsed properly up to 5 levels (eg. images in Summary section)
  3. Check if combine quotes are processed properly, eg.

image.png (270×264 px, 6 KB)

Reviewers: tomek, jon, atul, abosh

Reviewed By: tomek

Subscribers: ashoat, atul, abosh

Differential Revision: https://phab.comm.dev/D5033