Skip to content

Commit

Permalink
Upgrade redcarpet, fix header patch, fixes #92
Browse files Browse the repository at this point in the history
  • Loading branch information
lord committed Jul 28, 2014
1 parent 82a99d5 commit 8e7b03b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Version 1.1

*July 27th, 2014*

**Fixes:**

- Finally, a fix for the redcarpet upgrade bug

## Version 1.0

*July 2, 2014*
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ GEM
ffi (>= 0.5.0)
rb-kqueue (0.2.2)
ffi (>= 0.5.0)
redcarpet (3.1.1)
redcarpet (3.1.2)
ref (1.0.5)
rouge (1.3.3)
ruby18_source_location (0.2)
Expand Down
4 changes: 2 additions & 2 deletions lib/redcarpet_header_fix.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module RedcarpetHeaderFix
def header(text, level, id)
clean_id = id.gsub(/[\.]/, '-').gsub(/[^a-zA-Z0-9\-_]/, '')
def header(text, level)
clean_id = text.downcase.gsub(/( +|\.+)/, '-').gsub(/[^a-zA-Z0-9\-_]/, '')
"<h#{level} id='#{clean_id}'>#{text}</h#{level}>"
end
end
Expand Down

0 comments on commit 8e7b03b

Please sign in to comment.