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, Dec 21, 12:11 AM
Unknown Object (File)
Thu, Dec 12, 10:47 PM
Unknown Object (File)
Wed, Dec 11, 10:38 PM
Unknown Object (File)
Thu, Nov 28, 3:53 PM
Unknown Object (File)
Wed, Nov 27, 2:16 PM
Unknown Object (File)
Nov 26 2024, 3:49 PM
Unknown Object (File)
Nov 26 2024, 4:35 AM
Unknown Object (File)
Nov 26 2024, 4:35 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.