Class: Mdtoc::Markdown::HeaderWithFragment
- Defined in:
- lib/mdtoc/markdown.rb
Instance Method Summary collapse
-
#initialize(depth, label, url) ⇒ HeaderWithFragment
constructor
A new instance of HeaderWithFragment.
Methods inherited from Header
Constructor Details
#initialize(depth, label, url) ⇒ HeaderWithFragment
Returns a new instance of HeaderWithFragment.
35 36 37 38 |
# File 'lib/mdtoc/markdown.rb', line 35 def initialize(depth, label, url) url = "#{url}##{label.downcase.strip.gsub(/ /, '-').gsub(/[^\w\-_ ]/, '')}" super end |