Skip to content

HTML5 fragments inside markdown content emits warnings for elements without body #262

@gpakosz

Description

@gpakosz

Currently, the html parser expects XHTML content and will warn about non-self closing tags without body. E.g. <img> and <br> tags.

if !closed && HTML_ELEMENTS_WITHOUT_BODY.include?(el.value)
  warning("The HTML tag '#{el.value}' on line #{line} cannot have any content - auto-closing it")
  closed = true
end

in lib/kramdown/parser/html.rb:89

Could we get rid of or have an option to disable that specific warning? I guess nowadays more and more people expect to be able to have fragments of HTML5 inside their markdown documents.

Thanks!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions