Page MenuHomePhabricator

Preserve whitespace more faithfully when processing %%% remarkup blocks
ClosedPublic

Authored by epriestley on Dec 12 2014, 7:21 PM.
Tags
None
Referenced Files
F13398323: D10984.diff
Thu, Jul 4, 7:34 AM
F13376278: D10984.diff
Sat, Jun 29, 2:36 AM
F13359709: D10984.diff
Tue, Jun 25, 10:17 AM
F13352645: D10984.id26371.diff
Sun, Jun 23, 2:36 PM
F13345148: D10984.diff
Fri, Jun 21, 9:42 AM
F13343307: D10984.diff
Thu, Jun 20, 11:25 PM
F13332261: D10984.diff
Mon, Jun 17, 9:29 AM
F13262123: D10984.diff
May 27 2024, 1:48 AM

Details

Summary

This improves the output for some edge cases with %%% blocks. Notably, blocks did not emit a block-level spacing tag, so this:

%%%a%%%
%%%b%%%

...rendered on a single line.

Test Plan

Added unit tests.

Screen_Shot_2014-12-12_at_11.17.16_AM.png (822×549 px, 38 KB)

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Preserve whitespace more faithfully when processing %%% remarkup blocks.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
epriestley added a subscriber: chasemp.
btrahan edited edge metadata.
btrahan added inline comments.
src/markup/engine/remarkup/blockrule/PhutilRemarkupLiteralBlockRule.php
6–19

Not sure if this needs to be surfaced in the user-facing remarkup documentation at all or if this is esoteric, etc. just figured i'd call it out in case you hadn't thought of that part yet.

This revision is now accepted and ready to land.Dec 12 2014, 7:25 PM

The %%% block itself is documented:

https://secure.phabricator.com/book/phabricator/article/remarkup/#literal-blocks

I think this just makes the rule behave more "naturally" (i.e., do what you'd expect it to do after reading the documentation) so I'm not specifically updating the documentation. If we see user confusion about the behavior of the rule I could make the docs more explicit, but as long as users can figure out how to do what they want after reading the docs I don't want to explain all the parser details if we don't have to.

This revision was automatically updated to reflect the committed changes.