Jekyll: <br> tags are converted to <br /> tags

57 Views Asked by At

After building the website in Jekyll, all <br> tags contained in kramdown pages are converted to <br /> tags.

Does anybody know how to prevent this?

1

There are 1 best solutions below

2
Cristóbal Díaz Álvarez On

I guess is a fix applied by Jekyll. In html, the slash is optional, but in xhtml is mandatory.

<br> or <br /> or <br/> in html -> https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-br-element

<br /> or <br/> mandatory in xhtml -> https://en.wikipedia.org/wiki/XHTML