commonmark-spec
commonmark-spec copied to clipboard
Explictly state that indented code blocks must end with newline
The input *** without a newline at the end gets a newline added by the current dingus. This is sensible, because a normal fenced code block as a trailing newline.
```
code to the end
The same should be required for fenced code blocks without a closing fence.
An exception is the empty block as in example 96.
In conflict with this the HTML blocks strip the trailing newline: https://spec.commonmark.org/dingus/?text=%3Cdiv%3E%0A***%0A
cmark seems to diverge from commonmark.js (the code used on the dingus) for this latter case:
% cmark -t xml
<div>
...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document SYSTEM "CommonMark.dtd">
<document xmlns="http://commonmark.org/xml/1.0">
<html_block><div>
...
</html_block>
</document>
commonmark.js:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document SYSTEM "CommonMark.dtd">
<document xmlns="http://commonmark.org/xml/1.0">
<html_block><div>
...</html_block>
</document>