We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9557520 commit adfef7bCopy full SHA for adfef7b
lib/kramdown/converter/kramdown.rb
@@ -110,6 +110,7 @@ def convert_blockquote(el, opts)
110
end
111
112
def convert_header(el, opts)
113
+ opts[:in_header] = true
114
res = +''
115
res << "#{'#' * output_header_level(el.options[:level])} #{inner(el, opts)}"
116
res[-1, 1] = "\\#" if res[-1] == '#'
@@ -284,8 +285,8 @@ def convert_comment(el, _opts)
284
285
286
287
- def convert_br(_el, _opts)
288
- " \n"
+ def convert_br(_el, opts)
289
+ opts[:in_header] ? "<br />" : " \n"
290
291
292
def convert_a(el, opts)
test/testcases/block/04_header/with_line_break.html
@@ -0,0 +1 @@
1
+<h1>foo<br />bar</h1>
test/testcases/block/04_header/with_line_break.text
+# foo<br />bar
0 commit comments