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
F13995204: D20393.diff
Wed, Oct 23, 11:22 AM
F13976135: D20393.diff
Fri, Oct 18, 12:59 PM
F13954984: D20393.id48698.diff
Sun, Oct 13, 11:45 PM
Unknown Object (File)
Sun, Oct 13, 5:54 AM
Unknown Object (File)
Sun, Oct 13, 5:12 AM
Unknown Object (File)
Sun, Oct 13, 5:09 AM
Unknown Object (File)
Sat, Oct 12, 7:39 AM
Unknown Object (File)
Thu, Oct 10, 8:03 AM
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.