gitlab-org--gitlab-foss/lib/banzai/pipeline
Sean McGivern 03d2bf141c Fix description and GFM pipelines conflicting
Consider this command:

    bundle exec rails r "include GitlabMarkdownHelper
    puts markdown('<span>this is a span</span>', pipeline: :description)
    puts markdown('<span>this is a span</span>')"

And the same in the opposite order:

    bundle exec rails r "include GitlabMarkdownHelper
    puts markdown('<span>this is a span</span>')
    puts markdown('<span>this is a span</span>', pipeline: :description)"

Before this change, they would both output:

    <p><span>this is a span</span></p>
    <p>this is a span</p>

That's because `span` is added to the list of whitelisted elements in
the `SanitizationFilter`, but this method tries not to make the same
changes multiple times. Unfortunately,
`HTML::Pipeline::SanitizationFilter::LIMITED`, which is used by the
`DescriptionPipeline`, uses the same Ruby objects for all of its hash
values _except_ `:elements`.

That means that whichever of `DescriptionPipeline` and `GfmPipeline` is
called first would have `span` in its whitelisted elements, and the
second wouldn't.

Fix this by creating an entirely separate hash, before either pipeline
is invoked.
2016-06-13 13:06:40 +01:00
..
atom_pipeline.rb Prevent circular reference error in Banzai 2016-01-14 11:30:28 +01:00
base_pipeline.rb Remove redundant requires from Banzai files 2016-03-24 13:23:47 -04:00
broadcast_message_pipeline.rb Add FilterArray class to Banzai 2016-03-01 15:54:35 -05:00
combined_pipeline.rb Add FilterArray class to Banzai 2016-03-01 15:54:35 -05:00
description_pipeline.rb Fix description and GFM pipelines conflicting 2016-06-13 13:06:40 +01:00
email_pipeline.rb Prevent circular reference error in Banzai 2016-01-14 11:30:28 +01:00
full_pipeline.rb Prevent circular reference error in Banzai 2016-01-14 11:30:28 +01:00
gfm_pipeline.rb Create DiffFilter and change SystemNoteService#change_title to use Gitlab::Diff::InlineDiff 2016-05-18 11:15:10 -05:00
note_pipeline.rb Prevent circular reference error in Banzai 2016-01-14 11:30:28 +01:00
plain_markdown_pipeline.rb Add FilterArray class to Banzai 2016-03-01 15:54:35 -05:00
post_process_pipeline.rb Add FilterArray class to Banzai 2016-03-01 15:54:35 -05:00
pre_process_pipeline.rb Add YamlFrontMatterFilter to the PreProcessPipeline 2016-03-04 18:05:48 -05:00
single_line_pipeline.rb Add FilterArray class to Banzai 2016-03-01 15:54:35 -05:00
wiki_pipeline.rb Ensure correct filter order to validate with our markdown spec 2016-04-06 03:30:56 -03:00