google / gumbo-parser

An HTML5 parsing library in pure C99
Apache License 2.0
5.16k stars 663 forks source link

Fix empty the end of the tag <form> #397

Closed lifenjoiner closed 6 years ago

lifenjoiner commented 6 years ago

Fix for issue #350. Shall we?

googlebot commented 6 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


lifenjoiner commented 6 years ago

I signed it!

lifenjoiner commented 6 years ago

Travis CI build failed on it's own configuration.

craigbarnes commented 6 years ago

This patch causes a tree construction test to fail:

============================================================================                                   
test/tree-construction/tests6.dat:12: Test 2 failed                                                            
============================================================================                                   

Input:                                                                                                         
<!doctype html><form><div></form><div>                                                                         

Expected:                                                                                                      
| <!DOCTYPE html>                                                                                              
| <html>                                                                                                       
|   <head>                                                                                                     
|   <body>                                                                                                     
|     <form>                                                                                                   
|       <div>                                                                                                  
|         <div>                                                                                                

Received:                                                                                                      
| <!DOCTYPE html>                                                                                              
| <html>                                                                                                       
|   <head>                                                                                                     
|   <body>                                                                                                     
|     <form>
|       <div>
|     <div>

The patch in PR #372 works though.

lifenjoiner commented 6 years ago

Thanks for your reply! @craigbarnes You are right. It works on daily well formed HTML files, but not the quirk formed. I didn't pull the submodules recursively ...