Closed kevinhendricks closed 1 year ago
That still causes two tests to fail
======================================================================
FAIL: test_foreign-fragment_2 (test.html5lib_adapter.ConstructionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kovid/work/html5-parser/test/html5lib_adapter.py", line 164, in test_func
return self.implementation(inner_html, html, expected, errors, test_name)
File "/home/kovid/work/html5-parser/test/html5lib_adapter.py", line 207, in implementation
self.ae(expected, output, error_msg + '\n')
AssertionError: '| <font>\n| color=""\n| "X"' != '| <font>\n| color=""'
| <font>
- | color=""
? -
+ | color=""- | "X" :
Test name:
foreign-fragment
Input:
<font color></font>X
Expected:
| <font>
| color=""
| "X"
Received:
| <font>
| color=""
======================================================================
FAIL: test_foreign-fragment_3 (test.html5lib_adapter.ConstructionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kovid/work/html5-parser/test/html5lib_adapter.py", line 164, in test_func
return self.implementation(inner_html, html, expected, errors, test_name)
File "/home/kovid/work/html5-parser/test/html5lib_adapter.py", line 207, in implementation
self.ae(expected, output, error_msg + '\n')
AssertionError: '| <svg font>\n| "X"' != '| <svg font>'
- | <svg font>
? -
+ | <svg font>- | "X" :
Test name:
foreign-fragment
Input:
<font></font>X
Expected:
| <svg font>
| "X"
Received:
| <svg font>
I am not seeing any failures with my local sigil-gumbo version. I see you found and fixed your remaining issue be serializing the node tail if present.
I have been updating sigil-gumbo and ran into this as well.
The "solution" appears to be to replace this snippet from parser.c in handle_in_foreign_content:
with this:
This prevents the reprocessing from ending up back in handle_in_foreign_content causing the infinite loop stuck on a mathml integration point that will never get popped.
Instead or reprocessing it uses handle_html_content and returns it return value.
It effectively just uses the same approach as lower down in that same routine as shown here:
With these changes in place sigil-gumbo now passes all of the html5lib tests (including fragment tests) for tree-construction in TODAYS html5lib testing master (once they fixed that silly template mistake they made).
Hope this helps.