You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if it is possible to render HTML tags, e.g., <b>, <p>,<ul>, etc. as cell content, as part of the array passed to the "body" parameter?
So far I only managed to obtain the raw tags in the generated pdf. I also played around with the "didParseCell" hook and tried to replace tags and introduce newline characters, i.e, "\r\n" etc. to achieve simple line breaks in the cell, but without success. The "\r\n" seems to be removed before the rendering, and also remain as raw output. If linebreaks and other formatting is possible, is there a collection/doc for these options?
On the side, thank you very much for this valuable plugin!
EDIT: I have seen in #364 that it should work to have some tags like <br> as content, and that to be rendered as a line break. It is not the case for me, could this raise from a lack of configuration of the jspdf object on my end? Further, could the suggestion in #364 from @arjunkolagatla be a solution for me, that is, to intercept the case of HTML elements with Regex and treat them separately with "parseHTML" in some way?
The text was updated successfully, but these errors were encountered:
The only tag that is handled in a special way during html parsing is <br> (in addition to css styles). Everything else is converted to text using https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent. If you need more complex html parsing you can parse html yourself and pass data to the plugin directly. There are no plans to expand the the html parsing right now and doing so would be a breaking change.
Hi,
I was wondering if it is possible to render HTML tags, e.g.,
<b>, <p>,<ul>
, etc. as cell content, as part of the array passed to the "body" parameter?So far I only managed to obtain the raw tags in the generated pdf. I also played around with the "didParseCell" hook and tried to replace tags and introduce newline characters, i.e, "\r\n" etc. to achieve simple line breaks in the cell, but without success. The "\r\n" seems to be removed before the rendering, and
also remain as raw output. If linebreaks and other formatting is possible, is there a collection/doc for these options?
On the side, thank you very much for this valuable plugin!
EDIT: I have seen in #364 that it should work to have some tags like
<br>
as content, and that to be rendered as a line break. It is not the case for me, could this raise from a lack of configuration of the jspdf object on my end? Further, could the suggestion in #364 from @arjunkolagatla be a solution for me, that is, to intercept the case of HTML elements with Regex and treat them separately with "parseHTML" in some way?The text was updated successfully, but these errors were encountered: