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> and <figcaption> not recognized #32

Open
Garrett-R opened this issue Aug 18, 2020 · 2 comments
Open

<figure> and <figcaption> not recognized #32

Garrett-R opened this issue Aug 18, 2020 · 2 comments

Comments

@Garrett-R
Copy link

In the below snippet which I took from this page, <figure> and <figcaption> are not recognized:

In [1]: html = ''' 
   ...: <!DOCTYPE html> 
   ...:  
   ...: <html lang="en"> 
   ...:  
   ...: <head><title>Hello</title></head> 
   ...:  
   ...: <body> 
   ...:  
   ...:  
   ...:  
   ...: <figure> 
   ...:  
   ...:     <img src="/media/examples/elephant-660-480.jpg" 
   ...:  
   ...:          alt="Elephant at sunset"> 
   ...:  
   ...:     <figcaption>An elephant at sunset</figcaption> 
   ...:  
   ...: </figure> 
   ...:  
   ...:  
   ...:  
   ...: </body></html> 
   ...: '''                                                                                                                                                                  

In [2]: from tidylib import tidy_document                                                                                                                                    

In [3]: doc, errors = tidy_document(html)                                                                                                                                    

In [4]: print(errors)                                                                                                                                                        
line 12 column 1 - Error: <figure> is not recognized!
line 12 column 1 - Warning: discarding unexpected <figure>
line 18 column 5 - Error: <figcaption> is not recognized!
line 18 column 5 - Warning: discarding unexpected <figcaption>
line 18 column 38 - Warning: discarding unexpected </figcaption>
line 20 column 1 - Warning: discarding unexpected </figure>

I believe this HTML should not generate any warnings.

@countergram
Copy link
Owner

The warnings are from tidy; the bindings have no influence over them. It's been ages since I've used tidy, but are you on tidy5?

@Garrett-R
Copy link
Author

Oh my bad! I was on a very outdated version that was somehow already installed on my machine (libtidy-0.99.so.0.0.0). I upgraded to libtidy.so.5.2.0 and the above issue is no longer seen, so this be closed off.

Thank you for your help!

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