Horizontal Rule or Thematic Break?

Both the original and CommonMark specs use the term “horizontal rule” to describe Markdown syntax that produces an HTML <hr /> tag. However the HTML5 spec makes no mention of horizontal rules. Instead, the term “thematic break” is used to describe the meaning of the <hr> element:

The hr element represents a paragraph-level thematic break, e.g. a scene change in a story, or a transition to another topic within a section of a reference book.

The meaning has changed since HTML4, where <hr> did represent a horizontal rule:

The HR element causes a horizontal rule to be rendered by visual user agents.

The meaning was likely changed to make <hr> have semantic rather than presentational meaning, the same way that <i> and <b> were redefined.

To stay consistent with HTML5 it would be worth changing the terminology in the spec to “thematic break”. Also, the semantic meaning is more accurate; websites may style <hr> elements as images rather than horizontal rules, for example.

2 Likes

agreed. E.g. For many markdown based slideshow programs, they use --- horizontal rule to indicate new slide (thus next scene)

Good point about slides. I saw your topic about a possible slideshow extension; there may other ways of describing slides in HTML5, e.g. with <section>, but I have not looked into it in detail yet.

1 Like

In Jekyll, I replace <hr> with </section><section> - It works very well, especially when the output is parsed by software like revealjs.

1 Like

Is that default behaviour in Jekyll or is that a setting or modification?

@mofosyne it is pretty darn custom:

My layout has references to revealjs (just one of many slideshow software packages that use sections for slides) and adds the slide content to the pages:

<section>
{{ content | replace: "<hr />", "</section><section>" }}
</section>

Wish it were different, but I wanted this to work with good old fashioned github pages brand jekyll / kramdown. And wanted it to work now.

Thanks for having this discussion. Good stuff

1 Like

There is some discussion about adding sections automatically over in the Explict section not possible? topic. @mb21 and myself suggested a parser flag to add the section tags automatically based on the position of headers. Converting the thematic break into closing and opening section tags might be a sensible parser option too.

@jgm Any thoughts on this? I think this would be a good change to make to the spec before it reaches 1.0.

I’ve added it to the list. I think this is a reasonable change (the terminology change, not any change in rendering), but would like to hear if anyone has objections.

1 Like

Closely related thoughts at Horizontal Rules as Hierarchical Section Breaks etc., in Extensions.

I’ve made the terminological change in the spec and reference implementations.

2 Likes