mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 02:51:14 +08:00
FIX: Inline error when converting html to markdown
Looks like some html elements like `aside` and `section` will throw an error when checking if they are inline or not. The commit simply handles ``` Job exception: undefined method `inline?' for nil:NilClass ``` and adds a test for it.
This commit is contained in:
@ -99,7 +99,7 @@ class HtmlToMarkdown
|
||||
end
|
||||
|
||||
def is_inline?(node)
|
||||
node.text? || ("br" != node.name && node.description.inline? && node.children.all? { |n| is_inline?(n) })
|
||||
node.text? || ("br" != node.name && node.description&.inline? && node.children.all? { |n| is_inline?(n) })
|
||||
end
|
||||
|
||||
def collapse_spaces!(nodes, was_space = true)
|
||||
|
Reference in New Issue
Block a user