Page MenuHomePhabricator

Make the "Reply" and "Quote" Remarkup rules more similar
ClosedPublic

Authored by epriestley on Apr 10 2019, 8:07 PM.
Tags
None
Referenced Files
F19493362: D20393.diff
Thu, Jan 8, 8:50 AM
F19081671: D20393.diff
Dec 2 2025, 7:50 AM
F19081664: D20393.diff
Dec 2 2025, 7:48 AM
F19081655: D20393.diff
Dec 2 2025, 7:46 AM
F19081618: D20393.diff
Dec 2 2025, 7:41 AM
F19052076: D20393.diff
Nov 28 2025, 2:50 AM
F19003644: D20393.diff
Nov 21 2025, 9:22 AM
F18921785: D20393.id.diff
Nov 9 2025, 2:41 PM
Subscribers
None

Details

Summary

Previously, see D20327. The "Reply" and "Quote" remarkup rules currently have some copy/pastey-feeling code, and the "Reply" rule wasn't touched by D20327.

The difference is that a reply starts with >>! In X, Y wrote:, although the attribution line is freeform text.

Make them both subclasses of a quoted-thing rule and push as much logic as possible up into the base class.

Test Plan

Added a unit test, made it pass. Existing tests all still pass, except for minor adjustments which look like improvements to me.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

src/markup/engine/__tests__/remarkup/quoted-lists.txt
21–23

Oh, this and the one above are also behavioral: no more trailing whitespace.

src/markup/engine/__tests__/remarkup/quoted-quote.txt
2–5

This is the thing I'm trying to fix.

The version with no >>! was fixed by D20327, but this version didn't get touched because of the copy-pasteyness.

src/markup/engine/__tests__/remarkup/reply-basic.txt
12

Behavioral change: removal of extra empty newline. But seems like an improvement (more faithful to the input).

src/markup/engine/__tests__/remarkup/reply-nested.txt
44–48

Behavioral changes, but this output is more faithful to the input.

I confess to skimming this because it's mostly code shuffling and also includes a convincing unit test.

This revision is now accepted and ready to land.Apr 11 2019, 5:38 PM
This revision was automatically updated to reflect the committed changes.