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
Unknown Object (File)
Fri, Jun 17, 9:18 AM
Unknown Object (File)
Wed, Jun 15, 11:04 AM
Unknown Object (File)
Wed, Jun 15, 4:18 AM
Unknown Object (File)
Wed, Jun 15, 1:20 AM
Unknown Object (File)
Tue, Jun 14, 8:35 PM
Unknown Object (File)
Tue, Jun 14, 2:01 AM
Unknown Object (File)
May 27 2022, 4:28 PM
Unknown Object (File)
May 24 2022, 4:01 PM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.