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
Unknown Object (File)
Mon, Nov 25, 9:01 AM
Unknown Object (File)
Wed, Nov 20, 8:32 PM
Unknown Object (File)
Sat, Nov 16, 10:11 PM
Unknown Object (File)
Mon, Nov 11, 11:40 PM
Unknown Object (File)
Fri, Nov 8, 8:52 PM
Unknown Object (File)
Fri, Nov 8, 5:18 PM
Unknown Object (File)
Oct 27 2024, 10:37 PM
Unknown Object (File)
Oct 25 2024, 3:06 PM

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.