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
Unknown Object (File)
Sat, Mar 23, 10:13 AM
Unknown Object (File)
Feb 6 2024, 9:12 PM
Unknown Object (File)
Feb 3 2024, 10:04 PM
Unknown Object (File)
Feb 1 2024, 7:24 PM
Unknown Object (File)
Jan 25 2024, 11:35 AM
Unknown Object (File)
Jan 14 2024, 7:40 AM
Unknown Object (File)
Dec 27 2023, 1:11 PM
Unknown Object (File)
Dec 27 2023, 1:11 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.