Refactor trac.mimeview.pygments.GenshiHtmlFormatter for clarity.
|Reported by:||Owned by:|
|Severity:||minor||Keywords:||genshi mimeview highlighting|
generate() method currently does two things at once: it's chunking together tokens with the same class, and it's also outputting HTML tags. This patch separates them into two separate methods to improved clarity. Since both methods are just iterating over a generator, there's no additional memory overhead.
This does change code for the sake of just readability, but hopefully someone hacking on GenshiHtmlFormatter besides me will find it useful.
Change History (6)
comment:3 by , 12 years ago
|Status:||new → closed|