Skip to content

Commit bbb49db

Browse files
committed
HtmlRenderer: don't nest <strong>
1 parent f303e6b commit bbb49db

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/commonmarker/renderer/html_renderer.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,12 @@ def emph(_)
129129
out("<em>", :children, "</em>")
130130
end
131131

132-
def strong(_)
133-
out("<strong>", :children, "</strong>")
132+
def strong(node)
133+
if node.parent&.type == :strong
134+
out(:children)
135+
else
136+
out("<strong>", :children, "</strong>")
137+
end
134138
end
135139

136140
def link(node)

0 commit comments

Comments
 (0)