The "add header" feature of the editor doesn't add necessary newlines


(badp) #1

I’m not entirely sure that the m*******n editor Discourse uses is part of Discourse itself, but here goes: if you hit the “Header” button or Ctrl-H, the editor adds some header syntax in place without the necessary newlines.

In case you aren’t confused yet, a gif is worth a thousand words. The same happens on SE, for what it’s worth, but SE doesn’t actually have an “add header” button in its interface and that makes this feature well hidden there. :stuck_out_tongue: <!---- also worth noting that SE is m******n exclusive. —>


(Sam Saffron) #2

Legit bug, long term we plan to rewrite this bit in ember, in the mean time a PR to fix welcome.


(badp) #3

The fix seems to be somewhat trivial (just add a few \ns here), but again this is in a library you’re using so I think it’d be more appropriate to escalate to upstream. I suppose that’d be balpha’s pagedown?


(Sam Saffron) #4

sort of, we are already forked with a plan to rewrite the editor stuff in ember and move the markdown processing jgms CommonMark

A PR to fix this is welcome

Cc @balpha


(Sam Saffron) #5

This should do the trick

https://github.com/discourse/discourse/commit/8c214c35e441419cd7134b6749395fc7e99da4f1

https://github.com/discourse/discourse/commit/f5912a5500c61df04c23982e4798aea119ca029a


(Sam Saffron) #6