[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:
Now:
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:
- Spam with a lot of > and check if native app do not crash anymore.
- Check if nested quotes are parsed properly up to 5 levels (eg. images in Summary section)
- Check if combine quotes are processed properly, eg.
Reviewers: tomek, jon, atul, abosh
Reviewed By: tomek
Subscribers: ashoat, atul, abosh
Differential Revision: https://phab.comm.dev/D5033