Page MenuHomePhabricator

Write a simple parser to mangle `pygmentize` output to use email-friendly style attributes
ClosedPublic

Authored by epriestley on May 5 2016, 12:55 AM.
Tags
None
Referenced Files
F15531167: D15845.id38172.diff
Wed, Apr 23, 10:02 AM
F15520358: D15845.diff
Sun, Apr 20, 5:50 AM
F15463558: D15845.id.diff
Wed, Apr 2, 12:53 AM
F15463204: D15845.id38173.diff
Tue, Apr 1, 9:25 PM
F15461657: D15845.diff
Tue, Apr 1, 9:58 AM
F15454603: D15845.diff
Sat, Mar 29, 7:17 PM
F15445293: D15845.id.diff
Thu, Mar 27, 1:18 PM
F15438929: D15845.diff
Wed, Mar 26, 4:43 AM
Subscribers
None

Details

Summary

Ref T9790. This mangles pygmentize output so it does <span style="..."> instead of <span class="...">.

It doesn't use a regular expression, although it probably could.

I believe this is safe for all inputs, but it doesn't really matter: we'll only feed it safe inputs anyway, and it's only going to be used for email which we can't really do anything unsafe in.

Test Plan

Added unit tests; ran unit tests.

Diff Detail

Repository
rPHU libphutil
Branch
syntax1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 12049
Build 15172: Run Core Tests
Build 15171: arc lint + arc unit

Event Timeline

epriestley updated this revision to Diff 38173.
epriestley retitled this revision from to Write a simple parser to mangle `pygmentize` output to use email-friendly style attributes.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
  • Pick less linty test data.
chad edited edge metadata.
This revision is now accepted and ready to land.May 5 2016, 1:31 AM
This revision was automatically updated to reflect the committed changes.