diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-10-04 16:22:36 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-10-04 16:22:36 +0000 |
commit | 7887a3dafb6902cc39c831e307c48faf49f80b51 (patch) | |
tree | 36b4e4af36e72c522b0cf40582fdb824fb546f3b /spec/lib | |
parent | c38b85f37be87b64c08669aebacea4def6396911 (diff) | |
parent | f377f82651998dc56301cc6540867b5120da43f2 (diff) | |
download | gitlab-ce-7887a3dafb6902cc39c831e307c48faf49f80b51.tar.gz |
Merge branch 'code-blocks-vue-pre' into 'master'
Adds v-pre to code blocks in comments
## What does this MR do?
Allows users to comment on discussions with code that contains `{{`
Previously because of the discussion part being a Vue app it was being converted by Vue & therefore creating JS errors & the code not displaying correctly. This adds `v-pre` onto the code element to allow the user to write code that would contain `{{`
## What are the relevant issue numbers?
Closes #22911
See merge request !6674
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/banzai/filter/syntax_highlight_filter_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/lib/banzai/filter/syntax_highlight_filter_spec.rb b/spec/lib/banzai/filter/syntax_highlight_filter_spec.rb index b1370bca833..d265d29ee86 100644 --- a/spec/lib/banzai/filter/syntax_highlight_filter_spec.rb +++ b/spec/lib/banzai/filter/syntax_highlight_filter_spec.rb @@ -6,21 +6,21 @@ describe Banzai::Filter::SyntaxHighlightFilter, lib: true do context "when no language is specified" do it "highlights as plaintext" do result = filter('<pre><code>def fun end</code></pre>') - expect(result.to_html).to eq('<pre class="code highlight js-syntax-highlight plaintext"><code>def fun end</code></pre>') + expect(result.to_html).to eq('<pre class="code highlight js-syntax-highlight plaintext" v-pre="true"><code>def fun end</code></pre>') end end context "when a valid language is specified" do it "highlights as that language" do result = filter('<pre><code class="ruby">def fun end</code></pre>') - expect(result.to_html).to eq('<pre class="code highlight js-syntax-highlight ruby"><code><span class="k">def</span> <span class="nf">fun</span> <span class="k">end</span></code></pre>') + expect(result.to_html).to eq('<pre class="code highlight js-syntax-highlight ruby" v-pre="true"><code><span class="k">def</span> <span class="nf">fun</span> <span class="k">end</span></code></pre>') end end context "when an invalid language is specified" do it "highlights as plaintext" do result = filter('<pre><code class="gnuplot">This is a test</code></pre>') - expect(result.to_html).to eq('<pre class="code highlight js-syntax-highlight plaintext"><code>This is a test</code></pre>') + expect(result.to_html).to eq('<pre class="code highlight js-syntax-highlight plaintext" v-pre="true"><code>This is a test</code></pre>') end end @@ -31,7 +31,7 @@ describe Banzai::Filter::SyntaxHighlightFilter, lib: true do it "highlights as plaintext" do result = filter('<pre><code class="ruby">This is a test</code></pre>') - expect(result.to_html).to eq('<pre class="code highlight"><code>This is a test</code></pre>') + expect(result.to_html).to eq('<pre class="code highlight" v-pre="true"><code>This is a test</code></pre>') end end end |