Menu

#1 Support start attribute for ordered list

open
nobody
None
5
2012-08-06
2012-08-06
No

Hi!

Thank you for this convertor, I'm using it to automatically convert my CV and I left a link to your site from it's XHTML version.

I was missing support of start attribute for <ol>, which modifies number ordered list with decimal style starts from.

I include a small hacky patch that just solved my problem. Maybe someone will also need this.

Best regards,
Eugene Gilewski

Discussion

  • Eugene Gilewski

    Eugene Gilewski - 2012-08-06

    Hacky patch with implementation

     
  • Frédéric Lopez

    Your patch is incomplete, you also need to modify parsingCss.class.php :
    After :
    case 'list-style-image':
    if ($nom=='list-style') $nom = 'list-style-type';
    $this->value[$nom] = $val;
    break;
    Put :
    case 'start':
    $this->value[$nom] = $val;
    break;

    The default parameter for $start didn't work for me in PHP, so I had to add this code to html2pdf.class.php also (directly after // add the new level) :

    if ($start <= 0)
    $start = 1;

    Note that this way the start attribute doesn't work like in the W3C specs, you have to use it as a style attribute, ie. :
    <ol style="start:2;">

     
  • Eugene Gilewski

    Eugene Gilewski - 2012-11-09

    Unfortunately your change to html2pdf.class.php breaks my <ol start="0"> making it start from 1. Also neither with it nor without negative start numbers work. But I don't need that, be aware who do.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.