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

Warning: trimming empty <span> #10

Open
dfalbel opened this issue Aug 16, 2022 · 2 comments
Open

Warning: trimming empty <span> #10

dfalbel opened this issue Aug 16, 2022 · 2 comments

Comments

@dfalbel
Copy link

dfalbel commented Aug 16, 2022

With new CRAN checks for the HTML manual we are seeing warnings similar to those below when using katex::katex_html:

math_to_rd.html:81:795: Warning: trimming empty <span>
math_to_rd.html:81:1030: Warning: trimming empty <span>
math_to_rd.html:81:1116: Warning: trimming empty <span>

It seems that katex adds extra empty spans as they don't seem to be generated by something in the R package.

Further investigation:
katex generates spans like this that are used for vertical alignment but html tidy
seems to think they are useless and should be removed.

<span class="strut" style="height: 0.6833em"></span>

We could perhaps argue that HTML Tidy should be used with the option --drop-empty-elements set to no.

@jeroen
Copy link
Member

jeroen commented Aug 17, 2022

Yes I am aware, and reported this in tidy-html: htacg/tidy-html5#1046
I think r-base now defaults to --drop-empty-elements=no so the problem probably disappears: wch/r-source@f26715f

@dfalbel
Copy link
Author

dfalbel commented Aug 17, 2022

Oh awesome! That's great!

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

No branches or pull requests

2 participants