Forum


Replies: 10   Views: 4211
Footnotes and embedhtml()
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 shroom  · 21-12-2015 - 18:46

I think this is my last major issue.  I would like to know how to deal with footnotes in text that contains HTML.  I can create footnotes in plain text, but need some direction on how to deal with footnotes in HTML:

$thetext    = 'The quick <em>brown fox</em>[fn] jumped over the lazy <strong>sleeping dog</strong>.[fn]  And the story continues...';
$footnotes  = 'footnote for the italicized brown fox~~footnote for the bolded sleeping dog~~';

How would I process this to render BOTH the HTML and link the footnotes?  The [fn] markers indicate what the footnotes are attached to.  IE: the first [fn] marker references "footnote for the italicized brown fox" and the second marker references "footnote for the bolded sleeping dog".  Using addText(), I can properly attach the footnotes, but the HTML is not rendered.  It comes out like this:

The quick <em>brown fox</em>1 jumped over the lazy <strong>sleeping dog</strong>.2  And the story continues...

(at bottom of page..)
--------------------------------------
1 footnote for the italicised brown fox
2 footnote for the bolded sleeping dog

(Note that in the Word doc, the "1" and "2" are properly superscripted, but this editor does not show that)

So again, how would I process this to render BOTH the HTML and link the footnotes?  I would greatly appreciate it if you can point me in the right direction.