Ticket #3262 (closed defect: wontfix)
_html_splitlines reopens wrong tag in certain cases
| Reported by: | Tim Hatch <trac@…> | Owned by: | jonas |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | version control/browser | Version: | 0.10 |
| Severity: | normal | Keywords: | mimeviewer highlighting |
| Cc: |
Description
When run on the output of the PHP highlighter (php -sn), _html_splitlines chokes. This is due to having two different passes for opening and closing passes. It pretty much comes down to an incorrect interpretation of
<span class="x"> </span><span class="y">
The span open on the next line should be y, not x. This is solved by using a single regexp to walk the source, and keeping a more rigid stack of tags that are open. This is something that I've done before and am willing to code up a fix in a couple of days.
I'm attaching a patch to add a testcase in trac/mimeview/tests/api.py for this issue. This is actually a real-world issue for the following sample, when using the php-specific highlighter:
<?php /* comment */ ?>


