提交 848d13a8 编写于 作者: P Prem Sichanugrist 提交者: Prem Sichanugrist

Reuse parent's id if it's already exists

上级 efa7717b
......@@ -23,7 +23,7 @@ def render(body)
private
def dom_id(nodes)
nodes.map{ |node| node.text.downcase.gsub(/[^a-z0-9]+/, '-') }.join('-')
nodes.map{ |node| node[:id] ? node[:id] : node.text.downcase.gsub(/[^a-z0-9]+/, '-') }.join('-')
end
def engine
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册