BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
bc3448fc
Commit
bc3448fc
authored
Jan 16, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve spec
parent
37cabebe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
copy_as_gfm.js.es6
app/assets/javascripts/copy_as_gfm.js.es6
+4
-3
gfm_pipeline.rb
lib/banzai/pipeline/gfm_pipeline.rb
+4
-3
copy_as_gfm_spec.rb
spec/features/copy_as_gfm_spec.rb
+0
-0
No files found.
app/assets/javascripts/copy_as_gfm.js.es6
View file @
bc3448fc
...
...
@@ -3,9 +3,10 @@
(() => {
const gfmRules = {
// Should have an entry for every filter in lib/banzai/pipeline/gfm_pipeline.rb,
// in reverse order.
// Should have test coverage in spec/features/copy_as_gfm_spec.rb.
// The filters referenced in lib/banzai/pipeline/gfm_pipeline.rb convert GitLab Flavored Markdown (GFM) to HTML.
// These handlers consequently convert that same HTML to GFM to be copied to the clipboard.
// Every filter in lib/banzai/pipeline/gfm_pipeline.rb that generates HTML from GFM should have a handler here, in reverse order.
// The GFM-to-HTML-to-GFM cycle is tested in spec/features/copy_as_gfm_spec.rb.
InlineDiffFilter: {
'span.idiff.addition'(el, text) {
return `{+${text}+}`;
...
...
lib/banzai/pipeline/gfm_pipeline.rb
View file @
bc3448fc
module
Banzai
module
Pipeline
class
GfmPipeline
<
BasePipeline
# Every filter should have an entry in app/assets/javascripts/copy_as_gfm.js.es6,
# in reverse order.
# Should have test coverage in spec/features/copy_as_gfm_spec.rb.
# These filters convert GitLab Flavored Markdown (GFM) to HTML.
# The handlers defined in app/assets/javascripts/copy_as_gfm.js.es6 consequently convert that same HTML to GFM to be copied to the clipboard.
# Every filter that generates HTML from GFM should have a handler in app/assets/javascripts/copy_as_gfm.js.es6, in reverse order.
# The GFM-to-HTML-to-GFM cycle is tested in spec/features/copy_as_gfm_spec.rb.
def
self
.
filters
@filters
||=
FilterArray
[
Filter
::
SyntaxHighlightFilter
,
...
...
spec/features/copy_as_gfm_spec.rb
View file @
bc3448fc
This diff is collapsed.
Click to expand it.
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