Skip to content

Commit

Permalink
Reuse parent's id if it's already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sikachu committed Sep 17, 2012
1 parent efa7717 commit 848d13a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guides/rails_guides/markdown.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def render(body)
private private


def dom_id(nodes) 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 end


def engine def engine
Expand Down

0 comments on commit 848d13a

Please sign in to comment.