Class: Mdtoc::Markdown::HeaderWithFragment

Inherits:
Header
  • Object
show all
Defined in:
lib/mdtoc/markdown/header.rb

Instance Method Summary collapse

Methods inherited from Header

#to_s, #top_level?

Constructor Details

#initialize(depth, label, url) ⇒ HeaderWithFragment

Returns a new instance of HeaderWithFragment.



43
44
45
46
# File 'lib/mdtoc/markdown/header.rb', line 43

def initialize(depth, label, url)
  super
  @url += "##{@label.downcase.tr(" ", "-").gsub(/[^\w\-]/, "")}"
end