Skip to content

Commit

Permalink
* Fixed handling marked sections ending ]]]>
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Wielemaker committed May 22, 2002
1 parent 24b3de7 commit 897fe96
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* FIXED: Correctly handle marked sections ending in ]]]> rather than ]]>
Spotted by Adrian Boyko.

* ADDED: xml_quote_attribute/2 and xml_quote_cdata/2, providing simple
quote-support.

Expand Down
8 changes: 8 additions & 0 deletions Test/cdata.sgml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE test [
<!ELEMENT test - - (#PCDATA)>
]>

<test>
<![CDATA[[Ora Lassila]]]>
</test>

2 changes: 2 additions & 0 deletions Test/ok/cdata.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[element(test, [], ['[Ora Lassila]'])].
[].
2 changes: 1 addition & 1 deletion parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -4493,7 +4493,7 @@ putchar_dtd_parser(dtd_parser *p, int chr)
{ p->cdata->size -= 3; /* Delete chars for ]] */
pop_marked_section(p);
p->state = S_PCDATA;
} else
} else if ( f[CF_DSC] != chr ) /* if ]]], stay in this state */
p->state = S_MSCDATA;
return;
}
Expand Down

0 comments on commit 897fe96

Please sign in to comment.