jgm / djot

A light markup language
https://djot.net
MIT License
1.67k stars 43 forks source link

Syntax documenttation on thematic breaks contridicted by test #46

Closed leroycep closed 2 years ago

leroycep commented 2 years ago

The syntax documentation for thematic breaks says:

A line containing four or more * or - characters, and nothing else (except spaces or tabs) is treated is a thematic break (<hr> in HTML).

I interpreted this to mean four characters, excluding spaces.

However the first test in the thematic breaks file contradicts this:

https://github.com/jgm/djot/blob/47f9b3b3db91985180603ca5263ea2ec83d3e75d/test/thematic_breaks.test#L1-L11

Is the count supposed to include spaces, or should it only include * and - characters?

jgm commented 2 years ago

I've updated the docs to say "three or more," which is what the code says.

A case could be made for requiring four or more -- the case would be that --- is already an em-dash. However, that problem could also be solved by just requiring * characters for thematic breaks (as someone has already suggested on another issue).