Permalink
Browse files

Reuse parent's id if it's already exists

  • Loading branch information...
1 parent efa7717 commit 848d13a8aafccae1ae222ae4da20a35bf0bb6df3 @sikachu sikachu committed with sikachu Aug 31, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 guides/rails_guides/markdown.rb
@@ -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

0 comments on commit 848d13a

Please sign in to comment.