PHPPdf icon indicating copy to clipboard operation
PHPPdf copied to clipboard

link and span

Open smasala opened this issue 13 years ago • 3 comments

Hi,

If you have a span within a link then the content disappears

Example:

<a href="http://google.com"><span>here</span></a>

Thanks in advance

smasala avatar Sep 05 '12 14:09 smasala

I have just noticed that this is the case for any general nesting.

<span><span>
abc
</span></span>

smasala avatar Sep 05 '12 14:09 smasala

In my assumption, your code should be flatted into one linear element, and all styles should be used from the most external linear tag. In your first example expected result is anchor referenced to google page, with styles from "a" tag (not "span") and text "here". But this is not working in this way, this is a bug, so I will fix it as soon as possible ;)

Nesting in linear tags isn't fully supported - I forgot mention about this in documentation. To fix it, code responsible for text formatting will have to be totally reprojected. I think this is not critical, because the most results can be achieved in another way.

There is list of all linear tags: text, span, code, page-info, page-number, a, b, i, em

psliwa avatar Sep 05 '12 17:09 psliwa

Thanks for your quick replies and commits. The content is now visible. Sorry it has taken me so long to be able to test it. However here are some other possible examples.

Text examples: <span color="#ff0000">hello</span> -> output red

<a href="http://google.com"><span color="#ff0000">hello</span></a> -> output link but not red

<span color="#ff0000"><a href="http://google.com">hello</a></span> -> output red but no link

<span><span color="#ff0000"><a href="http://google.com">hello</a></span></span> -> output black, not red and no link

These kind of html markups are generated automatically by a rich-text editor. In this case ExtJS 4.1.1 HtmlEditor

smasala avatar Sep 14 '12 11:09 smasala