mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
Make non-terminated comments and cdata sections have 'the rest' as content
This commit is contained in:
parent
8f7f6abc16
commit
7489c134f7
@ -205,7 +205,10 @@ skip_comment(struct dom_scanner *scanner, unsigned char **string)
|
||||
}
|
||||
}
|
||||
|
||||
if (!pos) pos = scanner->end;
|
||||
if (!pos) {
|
||||
pos = scanner->end;
|
||||
length = pos - *string;
|
||||
}
|
||||
|
||||
*string = pos;
|
||||
return length;
|
||||
@ -227,7 +230,10 @@ skip_cdata_section(struct dom_scanner *scanner, unsigned char **string)
|
||||
}
|
||||
}
|
||||
|
||||
if (!pos) pos = scanner->end;
|
||||
if (!pos) {
|
||||
pos = scanner->end;
|
||||
length = pos - *string;
|
||||
}
|
||||
|
||||
*string = pos;
|
||||
return length;
|
||||
|
@ -64,17 +64,18 @@ element: root
|
||||
|
||||
test_output_equals \
|
||||
'Parse comment combinations.' \
|
||||
'<root><!-- <!-- -- > --><!----></root>' \
|
||||
'<root><!-- <!-- -- > --><!--foo--><!----></root>' \
|
||||
'
|
||||
element: root
|
||||
#comment: <!-- -- >
|
||||
#comment: foo
|
||||
#comment: '
|
||||
|
||||
test_output_equals \
|
||||
'Parse comment combinations.' \
|
||||
'<!--foo-->' \
|
||||
'Parse bad comment.' \
|
||||
'<!--->s' \
|
||||
'
|
||||
#comment: foo'
|
||||
#comment: ->s'
|
||||
|
||||
test_output_equals \
|
||||
'Parse an enclosed CDATA section.' \
|
||||
@ -83,6 +84,18 @@ test_output_equals \
|
||||
element: root
|
||||
#cdata-section: ...] ]>...'
|
||||
|
||||
test_output_equals \
|
||||
'Parse non-enclosed CDATA section.' \
|
||||
'<![CDATA[...]]>' \
|
||||
'
|
||||
#cdata-section: ...'
|
||||
|
||||
test_output_equals \
|
||||
'Parse a bad CDATA section.' \
|
||||
'<![CDATA[...' \
|
||||
'
|
||||
#cdata-section: ...'
|
||||
|
||||
test_output_equals \
|
||||
'Parse attributes.' \
|
||||
'<root lang="fr" attr name="value with &foo; <stuff"></root>' \
|
||||
|
Loading…
Reference in New Issue
Block a user