# frozen_string_literal: true require 'spec_helper' module Quby describe MarkdownParser do it 'handles list elements' do source = "* one\n* two" output = "" expect_markdown_transformation(source, output) end it 'it handles strong list elements' do source = "* **one**\n* two" output = "" expect_markdown_transformation(source, output) end it 'handles inline attributes' do source = "LET OP:" output = "

LET OP:

" expect_markdown_transformation(source, output) end it 'handles numbered lists' do source = "1. Item 1\n2. Item 2" output = "
    \n
  1. Item 1
  2. \n
  3. Item 2
  4. \n
" expect_markdown_transformation(source, output) end it 'can escape somerhing that looks like a numbered list' do source = "1\\. Item 1\n2\\. Item 2" output = "

1. Item 1\n2. Item 2

" expect_markdown_transformation(source, output) end it 'changes quotes to smartquotes' do source = "some 'quoted' word" output = "

some ‘quoted’ word

" expect_markdown_transformation(source, output) end it 'allows html-blocks and parses in between, but not inside.' do source = "

*bar*

\n\n# title\n\n" output = "

*bar*

\n\n

title

\n\n" expect_markdown_transformation(source, output) end it 'does not add emphasis within words' do source = "a word_with_underscores a word with _emphasis_" output = "

a word_with_underscores a word with emphasis

" expect_markdown_transformation(source, output) end it 'handles complex lists' do source = "*Uitvoering*
**Instrueer de revalidant om de paretische arm naast het hoofd te brengen in de flexiesynergie dat wil zeggen:** * **90º abductie** * **volledige exorotatie van de schouder** * **90º flexie met volledige supinatie**

*LET OP:
Bij twijfel of revalidant elevatie en retractie uit kan voeren mag je dit afzonderlijk meten. Revalidant moet hiervoor wel een deel van de beweging kunnen maken.
*" output = "

Uitvoering
\n " \ "Instrueer de revalidant om de paretische arm naast het hoofd te brengen in de flexiesynergie dat wil zeggen:

\n\n" \ "" expect_markdown_transformation(source, output) end def expect_markdown_transformation(source, output) expect(described_class.new(source).to_html).to eq(output) end end end