Forum


Replies: 3   Views: 2907
Embedhtml + parseanchors fails
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by efinfo  · 05-10-2016 - 14:35

I need to use internal link on html, but when i use parseAnchors  ( true ) ther result word is corrupt.

require_once '../classes/CreateDocx.inc';

$docx = new CreateDocx();
$html = '<a href="#tips">Visit the Useful Tips Section</a>';
$html .= '<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>';
$html .= '<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>';
$html .= '<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>';
$html .= '<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>';
$html .= '<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>';
$html .= '<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>';
$html .= '<h2 id="tips">Useful Tips Section</h2>';


$options = array('parseAnchors'=> true);

$docx->embedHTML($html,$options);
$docx->createDocx('example_embedHTML_1');

 

Posted by admin  · 06-10-2016 - 07:40

Hello,

Please wrap the a tag in a paragraph (or other block tags such as headings):

$html = '<p><a href="#tips">Visit the Useful Tips Section</a></p>';

to get a correct ouput.

Regards.

Posted by efinfo  · 06-10-2016 - 15:29

Deleted by efinfo · 06-10-2016 - 15:31

Posted by efinfo  · 06-10-2016 - 15:31

Thx is working now!