fix crash when loading html

This commit is contained in:
Bennet Bleßmann
2025-05-09 23:45:03 +02:00
committed by Mark Thom
parent cbdd0fbf15
commit 725def07cd
4 changed files with 95 additions and 19 deletions

11
tests-pl/issue2949.pl Normal file
View File

@@ -0,0 +1,11 @@
:- use_module(library(sgml)).
test :-
load_html("<!DOCTYPE html><html><head><title>Hello!</title></head></html>", Es, []),
write(Es),
load_html("<!DOCTYPE html><html><head><title>Hello!</title><!-- comment --></head></html>", Es2, []),
write(Es2),
load_html("<!", Es3, []),
write(Es3).
:- initialization(test).