Skip to content

Commit 38d3d7b

Browse files
committed
Bugfix for #257: HTML Reader: <p> and header tags puts no output
1 parent 39cf5d0 commit 38d3d7b

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
This is the changelog between releases of PHPWord. Releases are listed in reverse chronological order with the latest version listed on top, while additions/changes in each release are listed in chronological order. Changes in each release are divided into three parts: added or change features, bugfixes, and miscellaneous improvements. Each line contains short information about the change made, the person who made it, and the related issue number(s) in GitHub.
44

5+
## 0.11.1 - 2 June 2014
6+
7+
This is an immediate bugfix release for HTML reader.
8+
9+
- HTML Reader: `<p>` and header tags puts no output - @canyildiz @ivanlanin GH-257
10+
511
## 0.11.0 - 1 June 2014
612

713
This release marked the change of PHPWord license from LGPL 2.1 to LGPL 3. Four new elements were added: TextBox, ListItemRun, Field, and Line. Relative and absolute positioning for images and textboxes were added. Writer classes were refactored into parts, elements, and styles. ODT and RTF features were enhanced. Ability to add elements to PHPWord object via HTML were implemented. RTF and HTML reader were initiated.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.0
1+
0.11.1

src/PhpWord/Shared/Html.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,12 @@ private static function parseHeading($element, &$styles, $argument1)
224224
private static function parseText($node, $element, &$styles)
225225
{
226226
$styles['font'] = self::parseInlineStyle($node, $styles['font']);
227-
if (method_exists($element, 'addText')) {
227+
228+
// Commented as source of bug #257. `method_exists` doesn't seems to work properly in this case.
229+
// @todo Find better error checking for this one
230+
// if (method_exists($element, 'addText')) {
228231
$element->addText($node->nodeValue, $styles['font'], $styles['paragraph']);
229-
}
232+
// }
230233

231234
return null;
232235
}

0 commit comments

Comments
 (0)