Home GnuPG

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

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

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

Event Timeline