9

I was editing something in the Chart.js documentation (the mcve part) when a link wasn't displayed as it should be in the markdown preview.

While trying to fix this issue, I noticed that the <hr> written in the line above was triggering it.
The issue is reproducible on every anchor.

A quick fix is to add a new line between the <hr> and the link (as here).

This issue seems to exist with several HTML elements (not all of them though) :

  • <hr>, as stated above.
  • <br>, as shown here
  • <h1>, as shown here. Note that the issue is not reproducible with the <h2> though.
  • <table>, as shown here, which, of course, cannot be tested on other SO markdowns editors.
  • ... maybe more, I haven't tested them all

As Mike ans Squidward said in the comments, all of these HTML elements have markdown equivalents (# _ for <h1>_</h1>, --- for <hr>, etc.).
However, these markdown equivalents don't seem to trigger the issue.


But I am not looking for making these HTML elements work.

The thing is, since it works with the plain HTML on other markdown editors on SO, I wondered if everything is fine about it (and if I should have expected the result I had in the docs), or if it is a bug.

10
  • 1
    Is <hr> valid? Shouldn't it be <hr />? Hmm based on this I wouldn't say so ... inconsistent it is ...
    – rene
    Commented Aug 23, 2016 at 8:48
  • 8
    @rene The / in empty tags was only needed in XHTML - HTML doesn't require it. Commented Aug 23, 2016 at 15:17
  • @JamesThorpe yeah, I wasn't sure if the html here was maybe xhtml but that is long gone
    – rene
    Commented Aug 23, 2016 at 15:22
  • There are markdown equivalents to all of those HTML elements except <br>... Commented Aug 23, 2016 at 17:36
  • 1
    @MikeMcCaughan You'll have to pry my HTML tags from of my cold, dead hands...
    – canon
    Commented Aug 23, 2016 at 20:32
  • @MikeMcCaughan Double space?
    – Athari
    Commented Aug 23, 2016 at 20:58
  • @Squidward. I haven't tried. Might not work in comments... Commented Aug 23, 2016 at 20:59
  • @Squidward It doesn't look like that works for <br> in Documentation, at least for the preview. Commented Aug 23, 2016 at 21:14
  • 1
    @MikeMcCaughan Works for me: a__\nb => a<br>b (replace _ with space, comments are broken). Though I'd say that <br> should almost never be used. Paragraphs are preffered.
    – Athari
    Commented Aug 23, 2016 at 21:45
  • @Squidward Oh, I get it now. I was thinking just a double space with no newline. I agree about <br>, I've been trying to beat it out of my developers for years :). Commented Aug 23, 2016 at 23:03

0

Browse other questions tagged .