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

(disappeared) Fix totalPages and pageNumber DOM interpretation #6

Closed
medilies opened this issue Nov 19, 2023 · 0 comments · Fixed by #7
Closed

(disappeared) Fix totalPages and pageNumber DOM interpretation #6

medilies opened this issue Nov 19, 2023 · 0 comments · Fixed by #7
Assignees
Labels
bug Something isn't working

Comments

@medilies
Copy link
Member

medilies commented Nov 19, 2023

The bug disappeared after 5dd1358 and 4cd8101 commits


Not related to encoding

    public function toHtml(): string
    {
        $bodyElement = $this->dom->getElementsByTagName('body')->item(0);

        if (is_null($bodyElement)) {
            throw new RowBloomException('Error retrieving the DOM body element');
        }

        $htmlString = $this->dom->saveHTML($bodyElement);

        if ($htmlString === false) {
            throw new RowBloomException('An error occurred while dumping the internal document');
        }

        $htmlString = str_replace(['<body>', '</body>'], '', $htmlString);
++      var_dump(mb_detect_encoding($htmlString), $htmlString);
        return $htmlString;
    }

Tried footerTemplate: '{PAGENO}/{nbpg}', and footerTemplate: '<p><span class="pageNumber"></span>/<span class="totalPages"></span></p>',. Both codes output:

string(5) "ASCII"
string(22) "<p>{PAGENO}/{nbpg}</p>"
@medilies medilies added the bug Something isn't working label Nov 19, 2023
@medilies medilies changed the title Fix totalPages and pageNumber DOM interpretation [disappeared] Fix totalPages and pageNumber DOM interpretation Nov 19, 2023
@medilies medilies changed the title [disappeared] Fix totalPages and pageNumber DOM interpretation (disappeared Fix totalPages and pageNumber DOM interpretation Nov 19, 2023
@medilies medilies self-assigned this Nov 19, 2023
@medilies medilies moved this to In Progress in Open source Nov 19, 2023
@medilies medilies changed the title (disappeared Fix totalPages and pageNumber DOM interpretation (disappeared) Fix totalPages and pageNumber DOM interpretation Nov 19, 2023
@medilies medilies linked a pull request Nov 19, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in Open source Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant