Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont add newline after CDATA #221

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion render/xml/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ func (r *Renderer) codeBlock(w io.Writer, codeBlock *ast.CodeBlock) {
} else {
r.outs(w, "<![CDATA[")
r.out(w, codeBlock.Literal)
r.outs(w, "]]>\n")
r.outs(w, "]]>")
}
r.outs(w, "</"+name+">")
r.cr(w)
Expand Down
3 changes: 1 addition & 2 deletions testdata/artwork.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<artwork><![CDATA[println("hello")
]]>
</artwork>
]]></artwork>
3 changes: 1 addition & 2 deletions testdata/code-caption-id.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<figure anchor="golang"><name>This is a proper caption. </name>
<artwork><![CDATA[println("GO")
]]>
</artwork>
]]></artwork>
</figure>
3 changes: 1 addition & 2 deletions testdata/figure-anchor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SRO Param | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]>
</artwork>
]]></artwork>
</figure>
3 changes: 1 addition & 2 deletions testdata/include-block-caption.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<sourcecode type="c"><![CDATA[main() int {
return 0
}
]]>
</sourcecode>
]]></sourcecode>
</figure>
<t>And some other text.</t>
3 changes: 1 addition & 2 deletions testdata/include-block.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<sourcecode type="c"><![CDATA[main() int {
return 0
}
]]>
</sourcecode>
]]></sourcecode>
<t>And some other text.</t>
3 changes: 1 addition & 2 deletions testdata/sourcecode.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<sourcecode type="go"><![CDATA[println("hello")
]]>
</sourcecode>
]]></sourcecode>
3 changes: 1 addition & 2 deletions testdata/table-codeblock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
</tbody>
</table>
<sourcecode type="sh"><![CDATA[% cat /dev/zero
]]>
</sourcecode>
]]></sourcecode>
Loading