Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.8.0

Bug #11478 Invalid XHTML, </span> required before </li>
Submitted: 2007-06-29 02:22 UTC
From: marktaff Assigned: stoyan
Status: Closed Package: Text_Highlighter (version 0.7.0)
PHP Version: 4.3.11 OS: Linux
Roadmaps: (Not assigned)    

 [2007-06-29 02:22 UTC] marktaff (Mark A. Taff)
Description: ------------ Span tags are not being closed before the line ends, creating a xhtml error for almost every line! This invalid code of course screws up the CSS formatting. It seems like the root culprit throwing off your code is multi-line comments (and maybe other cases where in-line styles span multiple lines). Seems Html.php @ line 327 doesn't account to styles that need to span multiple
  • . See my software section and my portfolio section. Test script: ---------------
    1.  /** @file
    2.   * This file contains the KGameSvgDocument class, used for manipulating
    3.   * an SVG file using DOM.
    4.   */
    6.  /***************************************************************************
    7.   * Copyright (C) 2007 Mark A. Taff <> *
    8.   * *
    9.   * This program is free software; you can redistribute it and/or modify *
    10.   ***************************************************************************/
    12.  #ifndef _KGAMESVGDOCUMENT_H_
    13.  #define _KGAMESVGDOCUMENT_H_
    Expected result: ---------------- I expect open span tags to be closed before the </li> tag, then reopened after the <li> tag at the start of the next line.
  • Comments

     [2007-06-29 07:00 UTC] stoyan (Stoyan Stefanov)
    Thanks for the report and the patch, Mark! Patch worked excellent, just had to wrap it in an if so that it only applies when using lists and not tables or no lines numbers at all. Fixed now in CVS. Thanks again for your help, Stoyan
     [2007-06-29 08:21 UTC] marktaff (Mark A. Taff)
    yw Stoyan. Much easier to write a patch than write a highlighter from scratch. I've `svn up`, and it works fine here (at least that part; I want to dig into the colors more, and I need rules files for VB/VBS* and Bash as well). Cheers, Mark *I only code VB at [gun|knife]point. ;-)
     [2007-06-29 08:39 UTC] stoyan (Stoyan Stefanov)
    No VB as of yet :( The list is here: Can you check if the SH definition will work for you?
     [2007-06-29 23:02 UTC] marktaff (Mark A. Taff)
    On a cursory review, SH.php seems to work fine. See: One suggestion is to alias code types. I have code like so: // Be a bit more flexible with file type values if ( $type == 'js') { $type = 'javascript';} if ( $type == 'py') { $type = 'python';} if ( $type == 'c') { $type = 'cpp';} if ( $type == 'rb') { $type = 'ruby';} if ( $type == 'bash') { $type = 'sh';} While Sh and Bash are not identical, they are so very nearly so that the same highlighter will likely work fine for both. I'm going to check into writing an xslt transform to transform Kate's highlighting files (also xml, I think) into your input xml files. That would give us about 40+ languages in one fell swoop. --Mark