BigW Consortium Gitlab

Commit bc3448fc by Douwe Maan

Improve spec

parent 37cabebe
...@@ -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}+}`;
......
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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment