Homec4science

Fix an issue with highlighting PHP snippets with leading whitespace using XHPAST

Authored by epriestley <git@epriestley.com> on Mar 13 2016, 15:00.

Description

Fix an issue with highlighting PHP snippets with leading whitespace using XHPAST

Summary:
Ref T10576. In the test case there, XHPAST has incorrectly emitted an extra newline at the top of the output.

This cascades downward and throws every line off by one, highlighting the wrong lines in the output.

Fix this issue by stripping the prefix more carefully, so the input source is preserved accurately.

Test Plan:

  • Added tests; ran tests.
  • Verified that the snippet now highlights correctly.

{F1173155}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10576

Differential Revision: https://secure.phabricator.com/D15469

Details

Committed
epriestley <git@epriestley.com>Mar 13 2016, 15:44
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUf5f44f3a2c0b: Allow Remarkup tables to have leading space so they work correctly with quoting
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUd20d6e725037: Fix an issue with highlighting PHP snippets with leading whitespace using XHPAST (authored by epriestley <git@epriestley.com>).Mar 13 2016, 15:44