Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddHtml , img base64, ODtext : strange behavior #2240

Closed
ledahu opened this issue Jun 10, 2022 · 1 comment · Fixed by #2668
Closed

AddHtml , img base64, ODtext : strange behavior #2240

ledahu opened this issue Jun 10, 2022 · 1 comment · Fixed by #2668

Comments

@ledahu
Copy link

ledahu commented Jun 10, 2022

using Html::addHtml()

$html= "<body><p><img src="data:image/jpeg;base64,XXXXXXX" /></p></body>

writer HTML : ok
writer Word2007 : ok
writer ODText : img not showing, but existing without error in the ODT XML (odt is zip, just extract it)

then

$html= "<body><img src="data:image/jpeg;base64,XXXXXXX" /><p>stuff</p></body>

=> img showing in ODT

$html= "<body><div><img src="data:image/jpeg;base64,XXXXXXX" /></div></body>

=> img showing in ODT

just saying

Note: for those wondering how add /> in img,br,hr tag from summernote&other textarea editor, i use HTMLPurifier on the string :

 $config = HTMLPurifier_Config::createDefault();
        $config->set('URI.AllowedSchemes',array('data' => true));
        $this->HTMLPurifier=new HTMLPurifier($config);
@Progi1984
Copy link
Member

@ledahu This issue has been fixed by a maintainer. You can help him by sponsoring him through Github sponsors.

@Progi1984 Progi1984 self-assigned this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants