Skip to content

Ordered Lists from HTML don't restart numbering #508

Closed
@jelofson

Description

@jelofson

Have a loop which inserts html from a database. When a second ordered list is added (in a new section), the numbering does not restart. For example:

foreach ($rows as $row) {
    $section->addTitle(htmlspecialchars($row->title), 2);
    \PhpOffice\PhpWord\Shared\Html::addHtml($section, $row->somehtml);
}

Might result in something like this:

Section Title
bla bla

  1. list item
  2. list itme

New section title
text bla bla
3. list item
4. list item

I have to go into Word to manually set the starting number to 1.

I will see if I can dig into the code and find where this is set.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions