Skip to content

Wrong position of <w:br/> element in template processor #1926

Open
@SadPencil

Description

@SadPencil

Describe the Bug

The <w:br/> element is NOT inside a <w:r> element, which is against the ECMA-376 standard (section 17.3.3.1, on Page 323, the Fifth Edition, Part 1. You can download the standard here)

Although both Microsoft Word and LibreOffice can stand up with this error, other softwares that follow ECMA-376 can not, for example, WPS, the most popular office suite software in China.

Steps to Reproduce

See https://github.com/SadPencil/an-issue-of-php-office to reproduce it.

Expected Behavior

A <w:br/> element is generated correctly, which is contained by a <w:r> element.

So that every software recognizing DOCX format could happy.

Current Behavior

The <w:br/> element is NOT inside a <w:r> element

Context

  • PHP Version: PHP 7.3.14
  • PHPWord Version: dev-master, 072c3bf

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions