fix code formatting

This commit is contained in:
troosan 2018-04-14 21:15:36 +02:00
parent 6ba2df474f
commit 9bc85347ef
3 changed files with 6 additions and 6 deletions

View File

@ -20,6 +20,7 @@ v0.15.0 (?? ??? 2018)
- Added support for Image text wrapping distance @troosan #1310
- Added parsing of CSS line-height and text-indent in HTML reader @troosan #1316
- Added the ability to enable gridlines and axislabels on charts @FrankMeyer #576
- Added parsing of internal links in HTML reader @lalop #1336
### Fixed
- Fix reading of docx default style - @troosan #1238

View File

@ -723,10 +723,10 @@ class Html
}
self::parseInlineStyle($node, $styles['font']);
if(strpos($target, '#') === 0) {
return $element->addLink(substr($target, 1), $node->textContent, $styles['font'], $styles['paragraph'], true);
} else {
return $element->addLink($target, $node->textContent, $styles['font'], $styles['paragraph']);
if (strpos($target, '#') === 0) {
return $element->addLink(substr($target, 1), $node->textContent, $styles['font'], $styles['paragraph'], true);
}
return $element->addLink($target, $node->textContent, $styles['font'], $styles['paragraph']);
}
}

View File

@ -453,7 +453,7 @@ class HtmlTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($doc->elementExists('/w:document/w:body/w:p/w:hyperlink'));
$this->assertEquals('link text', $doc->getElement('/w:document/w:body/w:p/w:hyperlink/w:r/w:t')->nodeValue);
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$section->addBookmark('bookmark');
@ -464,7 +464,6 @@ class HtmlTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($doc->elementExists('/w:document/w:body/w:p/w:hyperlink'));
$this->assertTrue($doc->getElement('/w:document/w:body/w:p/w:hyperlink')->hasAttribute('w:anchor'));
$this->assertEquals('bookmark', $doc->getElement('/w:document/w:body/w:p/w:hyperlink')->getAttribute('w:anchor'));
}
public function testParseMalformedStyleIsIgnored()