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
1
Merge Requests
1
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
nexedi
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
...
@@ -50,7 +50,7 @@ module GitlabMarkdownHelper
end
end
html_doc
=
Nokogiri
::
HTML
(
@markdown
.
render
(
text
))
html_doc
=
Nokogiri
::
HTML
(
@markdown
.
render
(
text
))
html_doc
.
css
(
':not(li)'
).
each
{
|
dom
|
dom
[
:dir
]
=
:auto
}
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
end
# Return the first line of +text+, up to +max_chars+, after parsing the line
# 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
...
@@ -49,7 +49,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
"<h
#{
level
}
>
#{
text
}
</h
#{
level
}
>"
"<h
#{
level
}
>
#{
text
}
</h
#{
level
}
>"
else
else
id
=
ActionController
::
Base
.
helpers
.
strip_tags
(
h
.
gfm
(
text
)).
downcase
()
\
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
}
>"
"<h
#{
level
}
id=
\"
#{
id
}
\"
>
#{
text
}
<a href=
\"\#
#{
id
}
\"
></a></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