Welcome to mirror list, hosted at ThFree Co, Russian Federation.

markdown_filter_spec.rb « filter « banzai « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 897288b8ad53664dc79490f2ebf0677531fa12fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'spec_helper'

describe Banzai::Filter::MarkdownFilter, lib: true do
  include FilterSpecHelper

  context 'code block' do
    it 'adds language to lang attribute when specified' do
      result = filter("```html\nsome code\n```")

      expect(result).to start_with("\n<pre><code lang=\"html\">")
    end

    it 'does not add language to lang attribute when not specified' do
      result = filter("```\nsome code\n```")

      expect(result).to start_with("\n<pre><code>")
    end
  end
end