Sha256: 0f6a01dea1ed4945b6dcc55e5134039c0707fa78a9427edca8040d142f73584d

Contents?: true

Size: 950 Bytes

Versions: 1

Compression:

Stored size: 950 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Kitabu::Markdown do
  it "enables fenced code blocks" do
    html = Kitabu::Markdown.render <<-TEXT.strip_heredoc
      ```ruby
      class User
      end
      ```
    TEXT

    expect(html).to include('<pre class="highlight ruby">')
  end

  it "enables options" do
    html = Kitabu::Markdown.render <<-TEXT.strip_heredoc
    ```php?start_inline=true
    echo 'Hello';
    ```
    TEXT

    expect(html).to include('<span class="k">echo</span>')
  end

  it "enables line numbers" do
    html = Kitabu::Markdown.render <<-TEXT.strip_heredoc
    ```ruby?line_numbers=true
    class User
    end
    ```
    TEXT

    expect(html).to include(%[<table class="rouge-table">])
  end

  it "does not raise with unknown lexers" do
    expect do
      Kitabu::Markdown.render <<-TEXT.strip_heredoc
      ```terminal
      Text plain.
      ```
      TEXT
    end.not_to raise_error
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kitabu-3.0.3 spec/kitabu/markdown_spec.rb