Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
node-slate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Hải Sơn
node-slate
Commits
8e7b03b6
Commit
8e7b03b6
authored
Jul 28, 2014
by
Robert Lord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade redcarpet, fix header patch, fixes #92
parent
82a99d55
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
CHANGELOG.md
CHANGELOG.md
+8
-0
Gemfile.lock
Gemfile.lock
+1
-1
redcarpet_header_fix.rb
lib/redcarpet_header_fix.rb
+2
-2
No files found.
CHANGELOG.md
View file @
8e7b03b6
# Changelog
# Changelog
## Version 1.1
*July 27th, 2014*
**Fixes:**
-
Finally, a fix for the redcarpet upgrade bug
## Version 1.0
## Version 1.0
*July 2, 2014*
*July 2, 2014*
...
...
Gemfile.lock
View file @
8e7b03b6
...
@@ -96,7 +96,7 @@ GEM
...
@@ -96,7 +96,7 @@ GEM
ffi (>= 0.5.0)
ffi (>= 0.5.0)
rb-kqueue (0.2.2)
rb-kqueue (0.2.2)
ffi (>= 0.5.0)
ffi (>= 0.5.0)
redcarpet (3.1.
1
)
redcarpet (3.1.
2
)
ref (1.0.5)
ref (1.0.5)
rouge (1.3.3)
rouge (1.3.3)
ruby18_source_location (0.2)
ruby18_source_location (0.2)
...
...
lib/redcarpet_header_fix.rb
View file @
8e7b03b6
module
RedcarpetHeaderFix
module
RedcarpetHeaderFix
def
header
(
text
,
level
,
id
)
def
header
(
text
,
level
)
clean_id
=
id
.
gsub
(
/[\.]
/
,
'-'
).
gsub
(
/[^a-zA-Z0-9\-_]/
,
''
)
clean_id
=
text
.
downcase
.
gsub
(
/( +|\.+)
/
,
'-'
).
gsub
(
/[^a-zA-Z0-9\-_]/
,
''
)
"<h
#{
level
}
id='
#{
clean_id
}
'>
#{
text
}
</h
#{
level
}
>"
"<h
#{
level
}
id='
#{
clean_id
}
'>
#{
text
}
</h
#{
level
}
>"
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment