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
Tatuya Kamada
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
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
163 additions
and
157 deletions
+163
-157
app/assets/javascripts/copy_as_gfm.js.es6
app/assets/javascripts/copy_as_gfm.js.es6
+4
-3
lib/banzai/pipeline/gfm_pipeline.rb
lib/banzai/pipeline/gfm_pipeline.rb
+4
-3
spec/features/copy_as_gfm_spec.rb
spec/features/copy_as_gfm_spec.rb
+155
-151
No files found.
app/assets/javascripts/copy_as_gfm.js.es6
View file @
bc3448fc
...
@@ -3,9 +3,10 @@
...
@@ -3,9 +3,10 @@
(() => {
(() => {
const gfmRules = {
const gfmRules = {
// Should have an entry for every filter in lib/banzai/pipeline/gfm_pipeline.rb,
// The filters referenced in lib/banzai/pipeline/gfm_pipeline.rb convert GitLab Flavored Markdown (GFM) to HTML.
// in reverse order.
// These handlers consequently convert that same HTML to GFM to be copied to the clipboard.
// Should have test coverage in spec/features/copy_as_gfm_spec.rb.
// 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: {
InlineDiffFilter: {
'span.idiff.addition'(el, text) {
'span.idiff.addition'(el, text) {
return `{+${text}+}`;
return `{+${text}+}`;
...
...
lib/banzai/pipeline/gfm_pipeline.rb
View file @
bc3448fc
module
Banzai
module
Banzai
module
Pipeline
module
Pipeline
class
GfmPipeline
<
BasePipeline
class
GfmPipeline
<
BasePipeline
# Every filter should have an entry in app/assets/javascripts/copy_as_gfm.js.es6,
# These filters convert GitLab Flavored Markdown (GFM) to HTML.
# in reverse order.
# 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.
# Should have test coverage in spec/features/copy_as_gfm_spec.rb.
# 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
def
self
.
filters
@filters
||=
FilterArray
[
@filters
||=
FilterArray
[
Filter
::
SyntaxHighlightFilter
,
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