Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
3913f247
Commit
3913f247
authored
Dec 29, 2014
by
Sacred Seven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better fix for #4
parent
a133cf3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/helpers/gitlab_markdown_helper.rb
app/helpers/gitlab_markdown_helper.rb
+1
-1
lib/redcarpet/render/gitlab_html.rb
lib/redcarpet/render/gitlab_html.rb
+1
-1
No files found.
app/helpers/gitlab_markdown_helper.rb
View file @
3913f247
...
...
@@ -50,7 +50,7 @@ module GitlabMarkdownHelper
end
html_doc
=
Nokogiri
::
HTML
(
@markdown
.
render
(
text
))
html_doc
.
css
(
':not(li)'
).
each
{
|
dom
|
dom
[
:dir
]
=
:auto
}
html_doc
.
to_html
.
gsub
(
%r{
\{
anchor=([
\w
-]+)
\}
}m
)
{
|
match
|
"<a name=
\'
#{
$1
}
\'
></a>"
}.
html_safe
html_doc
.
to_html
.
html_safe
end
# Return the first line of +text+, up to +max_chars+, after parsing the line
...
...
lib/redcarpet/render/gitlab_html.rb
View file @
3913f247
...
...
@@ -49,7 +49,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
"<h
#{
level
}
>
#{
text
}
</h
#{
level
}
>"
else
id
=
ActionController
::
Base
.
helpers
.
strip_tags
(
h
.
gfm
(
text
)).
downcase
()
\
.
gsub
(
/[^
a-z0-9_
-]/
,
'-'
).
gsub
(
/-+/
,
'-'
).
gsub
(
/^-/
,
''
).
gsub
(
/-$/
,
''
)
.
gsub
(
/[^
\p{Word}
-]/
,
'-'
).
gsub
(
/-+/
,
'-'
).
gsub
(
/^-/
,
''
).
gsub
(
/-$/
,
''
)
"<h
#{
level
}
id=
\"
#{
id
}
\"
>
#{
text
}
<a href=
\"\#
#{
id
}
\"
></a></h
#{
level
}
>"
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