Separate the remarkup rendering pipeline into multiple stages
Summary:
See T367. It's desirable for some pieces of Remarkup syntax to be live (e.g.,
references to tasks) while others should be cached (e.g., syntax highlighting,
which is very slow).
This separates the Remarkup pipeline into a "pre-processing" stage, where rules
emit normal output, metadata, and a token map, and a "post-processing" stage
where rules may alter the metadata and token map before they are reunified.
This has the additional advnatage that we can now batch markup requests across
blocks, and, in the future, across texts.
This change has no impact on existing callers, it only provides additional
capabilities to the API.
Test Plan:
- Rewrote the mentions rule to happen in post-processing; it works correctly.
- Triggered a bunch of rules in the Phriction live preview.
Reviewed By: jungejason
Reviewers: hunterbridges, jungejason, tuomaspelkonen, aran
CC: aran, jungejason
Differential Revision: 737