mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -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;
|
*string = pos;
|
||||||
return length;
|
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;
|
*string = pos;
|
||||||
return length;
|
return length;
|
||||||
|
@ -64,17 +64,18 @@ element: root
|
|||||||
|
|
||||||
test_output_equals \
|
test_output_equals \
|
||||||
'Parse comment combinations.' \
|
'Parse comment combinations.' \
|
||||||
'<root><!-- <!-- -- > --><!----></root>' \
|
'<root><!-- <!-- -- > --><!--foo--><!----></root>' \
|
||||||
'
|
'
|
||||||
element: root
|
element: root
|
||||||
#comment: <!-- -- >
|
#comment: <!-- -- >
|
||||||
|
#comment: foo
|
||||||
#comment: '
|
#comment: '
|
||||||
|
|
||||||
test_output_equals \
|
test_output_equals \
|
||||||
'Parse comment combinations.' \
|
'Parse bad comment.' \
|
||||||
'<!--foo-->' \
|
'<!--->s' \
|
||||||
'
|
'
|
||||||
#comment: foo'
|
#comment: ->s'
|
||||||
|
|
||||||
test_output_equals \
|
test_output_equals \
|
||||||
'Parse an enclosed CDATA section.' \
|
'Parse an enclosed CDATA section.' \
|
||||||
@ -83,6 +84,18 @@ test_output_equals \
|
|||||||
element: root
|
element: root
|
||||||
#cdata-section: ...] ]>...'
|
#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 \
|
test_output_equals \
|
||||||
'Parse attributes.' \
|
'Parse attributes.' \
|
||||||
'<root lang="fr" attr name="value with &foo; <stuff"></root>' \
|
'<root lang="fr" attr name="value with &foo; <stuff"></root>' \
|
||||||
|
Loading…
Reference in New Issue
Block a user