Skip to content

Commit

Permalink
Bugfix for #257: HTML Reader: <p> and header tags puts no output
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanlanin committed Jun 2, 2014
1 parent 39cf5d0 commit 38d3d7b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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.

## 0.11.1 - 2 June 2014

This is an immediate bugfix release for HTML reader.

- HTML Reader: `<p>` and header tags puts no output - @canyildiz @ivanlanin GH-257

## 0.11.0 - 1 June 2014

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.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.0
0.11.1
7 changes: 5 additions & 2 deletions src/PhpWord/Shared/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ private static function parseHeading($element, &$styles, $argument1)
private static function parseText($node, $element, &$styles)
{
$styles['font'] = self::parseInlineStyle($node, $styles['font']);
if (method_exists($element, 'addText')) {

// Commented as source of bug #257. `method_exists` doesn't seems to work properly in this case.
// @todo Find better error checking for this one
// if (method_exists($element, 'addText')) {
$element->addText($node->nodeValue, $styles['font'], $styles['paragraph']);
}
// }

return null;
}
Expand Down

0 comments on commit 38d3d7b

Please sign in to comment.