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
52145483
Commit
52145483
authored
Jul 01, 2016
by
Paco Guzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Metrics for Rouge::Plugins::Redcarpet and Rouge::Formatters::HTMLGitlab
parent
ab81ea1e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
CHANGELOG
CHANGELOG
+1
-0
config/initializers/metrics.rb
config/initializers/metrics.rb
+3
-0
lib/banzai/filter/syntax_highlight_filter.rb
lib/banzai/filter/syntax_highlight_filter.rb
+7
-2
No files found.
CHANGELOG
View file @
52145483
...
@@ -26,6 +26,7 @@ v 8.10.0 (unreleased)
...
@@ -26,6 +26,7 @@ v 8.10.0 (unreleased)
- Better caching of git calls on ProjectsController#show.
- Better caching of git calls on ProjectsController#show.
- Add API endpoint for a group issues !4520 (mahcsig)
- Add API endpoint for a group issues !4520 (mahcsig)
- Add Bugzilla integration !4930 (iamtjg)
- Add Bugzilla integration !4930 (iamtjg)
- Metrics for Rouge::Plugins::Redcarpet and Rouge::Formatters::HTMLGitlab
- Allow [ci skip] to be in any case and allow [skip ci]. !4785 (simon_w)
- Allow [ci skip] to be in any case and allow [skip ci]. !4785 (simon_w)
- Add basic system information like memory and disk usage to the admin panel
- Add basic system information like memory and disk usage to the admin panel
...
...
config/initializers/metrics.rb
View file @
52145483
...
@@ -132,6 +132,9 @@ if Gitlab::Metrics.enabled?
...
@@ -132,6 +132,9 @@ if Gitlab::Metrics.enabled?
config
.
instrument_instance_methods
(
API
::
Helpers
)
config
.
instrument_instance_methods
(
API
::
Helpers
)
config
.
instrument_instance_methods
(
RepositoryCheck
::
SingleRepositoryWorker
)
config
.
instrument_instance_methods
(
RepositoryCheck
::
SingleRepositoryWorker
)
config
.
instrument_instance_methods
(
Rouge
::
Plugins
::
Redcarpet
)
config
.
instrument_instance_methods
(
Rouge
::
Formatters
::
HTMLGitlab
)
end
end
GC
::
Profiler
.
enable
GC
::
Profiler
.
enable
...
...
lib/banzai/filter/syntax_highlight_filter.rb
View file @
52145483
...
@@ -27,12 +27,17 @@ module Banzai
...
@@ -27,12 +27,17 @@ module Banzai
highlighted
=
"<pre>
#{
code
}
</pre>"
highlighted
=
"<pre>
#{
code
}
</pre>"
end
end
#
Replace the parent `pre` element with the entire highlighted block
#
Extracted to a method to measure it
node
.
parent
.
replace
(
highlighted
)
replace_parent_pre_element
(
node
,
highlighted
)
end
end
private
private
def
replace_parent_pre_element
(
node
,
highlighted
)
# Replace the parent `pre` element with the entire highlighted block
node
.
parent
.
replace
(
highlighted
)
end
# Override Rouge::Plugins::Redcarpet#rouge_formatter
# Override Rouge::Plugins::Redcarpet#rouge_formatter
def
rouge_formatter
(
lexer
)
def
rouge_formatter
(
lexer
)
Rouge
::
Formatters
::
HTMLGitlab
.
new
(
Rouge
::
Formatters
::
HTMLGitlab
.
new
(
...
...
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