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

Figure tag at the beginning prevents rendering its image #3423

Open
medilies opened this issue Mar 26, 2024 · 2 comments
Open

Figure tag at the beginning prevents rendering its image #3423

medilies opened this issue Mar 26, 2024 · 2 comments
Labels
Milestone

Comments

@medilies
Copy link

$works = "x<figure class='image'><img src='https://http.cat/100'></figure>";;
$doesNotWork = "<figure class='image'><img src='https://http.cat/100'></figure>";

$dom = new Dompdf\Dompdf(['isRemoteEnabled' => true]);
$dom->loadHtml($works);
$dom->render();
$dom->output();

$dom->loadHtml($doesNotWork);
$dom->render();
$dom->output();
@bsweeney bsweeney added the bug label Mar 26, 2024
@bsweeney bsweeney added this to the 3.0.1 milestone Mar 26, 2024
@bsweeney
Copy link
Member

bsweeney commented Mar 26, 2024

Does appear to be the case. I don't see what's causing the issue on initial look, so I'll have to spend some more time with it.

To render the element, you don't have to precede with content. Surrounding it with any other element does the trick.

@medilies
Copy link
Author

Im doing this for now

        if(preg_match('/^\s*<figure/i' ,$template) === 1) {
            $template = '<span></span>'.$template;
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants