Class: Mdtoc::Markdown::HeaderWithFragment
- Defined in:
- lib/mdtoc/markdown/header.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/header.rb', line 35 def initialize(depth, label, url) url = "#{url}##{label.strip.downcase.tr(' ', '-').gsub(/[^\w\-]/, '')}" super end |