# encoding: utf-8 Feature: All the possibilities of HTML parser Scenario Outline: Inplace tags Given we use "html" bowler When the input string is And the execute method is called on bowler Then the result should equal to Examples: | input | output | | "here ≈italic≈ goes" | "here italic goes" | | "here ≡bold≡ goes" | "here bold goes" | | "here ↓small↓ goes" | "here small goes" | | "here ↑sup↑ goes" | "here sup goes" | | "here abbr†desc ription† goes" | "here abbr goes" | | "here ✁del✁ goes" | "here del goes" | | "here ✿_span_nobrnobr✿_span_nobr goes" | "here nobr goes" | | "here ÷deleted÷ goes" | "here deleted goes" | | "here λcodeλ goes" | "here code goes" | | "here ≡λbold codeλ≡ goes" | "here bold code goes" | | "here λ≡code bold≡λ goes" | "here code bold goes" | | "Hello, ≈World≈!" | "Hello, World!" | Scenario Outline: Inplace tags nested Given we use "html" bowler When the input string is And the execute method is called on bowler Then the result should NOT equal to Examples: | input | output | | "here ≡nested ≡bold≡ tags≡ go" | "here nested bold tags goes" | Scenario Outline: Alone tags Given we use "html" bowler When the input string is And the execute method is called on bowler Then the result should equal to Examples: | input | output | | "A ⏎ B" | "A B" | | "A —— B" | "A B" | Scenario: Block tag Λ Given we use "html" bowler When the input string is """ Λ ruby @mapping[:block] = ≡bold≡ Λ """ And the execute method is called on bowler Then the result should equal to """ @mapping[:block] = ≡bold≡ """ Scenario: Block tag ✍ Given we use "html" bowler When the input string is """ ✍ ruby @mapping[:block] = ≡bold≡ ✍ """ And the execute method is called on bowler Then the result should equal to """ """ Scenario Outline: Video tags Given we use "html" bowler When the input string is And the execute method is called on bowler Then the result should match " And the execute method is called on bowler Then the result should equal to Examples: | input | output | | "☎ +1(987)5554321" | "☎ +1(987)5554321" | | "✉ info_twitter.com" | "✉ info_twitter.com" | | "✎ mudasobwa" | "mudasobwa" | | "☇ id001" | "" | Scenario Outline: Custom tags Given we use "html" bowler When the input string is And the execute method is called on bowler Then the result should equal to Examples: | input | output | | "‒ Wikipedia, http://wikipedia.org" | " Wikipedia" | | "Wikipedia¹http://wikipedia.org" | "Wikipedia" | | "Wikipedia†Best knowledge base†" | "Wikipedia" | | "Inplace picture¹http://mudasobwa.ru/images/am.jpg goes here." | " goes here." | | "http://mudasobwa.ru/images/am.jpg Standalone picture" | " ␍ ␍ ␍ ␍ Standalone picture ␍ ␍ ␍ " | Scenario Outline: Markdown atavisms ⇒ links Given we use "html" bowler When the input string is And the execute method is called on bowler Then the result should equal to Examples: | input | output | | "Here ![Image](http://mudasobwa.ru/images/am.jpg) goes" | "Here goes" | | "![Figure](http://mudasobwa.ru/images/am.jpg)" | " ␍ ␍ ␍ ␍ Figure ␍ ␍ ␍ " | | "Here [Link](http://wikipedia.org/) goes" | "Here Link goes" | | "Here *italic* goes" | "Here italic goes" | | "Here inplace*it*alic goes" | "Here inplaceitalic goes" | | "Here non-italic 5*3 math goes" | "Here non-italic 5*3 math goes" | | "Here **bold** goes" | "Here bold goes" | | "Here ~~del~~ goes" | "Here del goes" | | "Here `code` goes" | "Here code goes" | Scenario Outline: Regular tags Given we use "html" bowler When the input string is And the execute method is called on bowler Then the result should equal to Examples: | input | output | | "List: • li1 • li2" | "List: li1 li2" | | "List: • li1 • nested 1 • nested 2 • li2" | "List: li1 nested 1 nested 2 li2" | | "Data: ▶ dt — dd ▶ dt — dd" | "Data: ␍ dt ␍ dd ␍ ␍ dt ␍ dd ␍ " | | "§1 Header" | "Header" | | "〉 Blockquote" | "Blockquote" | Scenario Outline: Self tags Given we use "html" bowler When the input string is And the execute method is called on bowler Then the result should equal to Examples: | input | output | | "here qipowl goes" | "here qipowl goes" | | "here Qipowl goes" | "here Qipowl goes" | | "here tag goes" | "here tag goes" | | "here tag2 goes" | "here tag2 goes" | | "here tag3 goes" | "here tag3 goes" | Scenario: Address tag Given we use "html" bowler When the input string is "℁ ≡Twitter≡ ⏎ ☎ +1(987)5554321 ⏎ ✉ info@twitter.com" And the execute method is called on bowler Then the result should equal to "Twitter ☎ +1(987)5554321 ✉ info@twitter.com" Scenario: Entity addition Given we use "html" bowler When the input string is "List: × li1 line item × li2" And rule "×" is added to mapping as "li" in "regular" section with "ol" enclosure And the execute method is called on bowler Then the result should equal to "List: li1 line item li2" Scenario: Entity removal Given we use "html" bowler When the input string is "List: ◦ li1 ◦ li2" And rule "◦" is removed from mapping And the execute method is called on bowler Then the result should equal to "List: ◦ li1 ◦ li2" Scenario: Standalone images Given we use "html" bowler When the input string is """ ✍ Preamble: given ✍ 〉 http://mudasobwa.ru/i/self.jpg With caption ‒ Wiki, http://wikipedia.ru Nice? """ And the execute method is called on bowler Then the result should equal to """ http://mudasobwa.ru/i/self.jpg With caption Wiki Nice? """ Scenario: Comments Given we use "html" bowler When the input string is """ --- This is a comment text --- Nice? """ And the execute method is called on bowler Then the result should equal to """ Nice? """ Scenario: Blockquotes Given we use "html" bowler When the input string is """ §2 Blockquotes 〉 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante. 〉 Nested blockquote first line 〉 Nested blockquote second line 〉 Lorem ipsum para text 2. Some para text. 〉 Intro 1. • list item ≡with bold≡ 1 • list item ≈emphasized≈ • nested list item 1 • nested list item 2 〉 Blockquote standalone. 〉 Intro 2. • list item 2.1 • list item 2.2 〉 Continuing intro 2. Blockquote standalone. """ And the execute method is called on bowler Then the result should match "Nested blockquote first" And the result should match " nested list item 1" And the result should match "Blockquote standalone." Scenario Outline: Postprocessing: spaces Given we use "html" bowler When the input string is And the execute method is called on bowler Then the result should equal to Examples: | input | output | | "here «quote» goes" | "here «quote» goes" | | "here « quote¹http://wikipedia.org » goes" | "here «quote» goes" | | "This is λsystem.dllλ file." | "This is system.dll file." | | "This is ✓8:35✓ time." | "This is 8:35 time." | Scenario: Video embedded Given we use "html" bowler When the input string is """ http://qipowl.herokuapp.com/images/owl.png ☞ Video embedded: http://www.youtube.com/watch?v=KFKxlYNfT_o """ And the execute method is called on bowler Then the result should equal to """ Video embedded: """
here italic goes
here bold goes
here small goes
here sup goes
here abbr goes
here del goes
here nobr goes
here deleted goes
here code goes
code
here bold code goes
bold code
here code bold goes
code bold
Hello, World!
here nested bold tags goes
A B
A
B
@mapping[:block] = ≡bold≡
☎ +1(987)5554321
✉ info_twitter.com
mudasobwa
Wikipedia
goes here.
Standalone picture
Here goes
Figure
Here Link goes
Here italic goes
Here inplaceitalic goes
Here non-italic 5*3 math goes
Here bold goes
Here del goes
Here code goes
List:
Data:
Blockquote
here qipowl goes
here Qipowl goes
here tag goes
here tag2 goes
here tag3 goes
List: ◦ li1 ◦ li2
http://mudasobwa.ru/i/self.jpg With caption Wiki
Nice?
Nested blockquote first" And the result should match " nested list item 1" And the result should match "Blockquote standalone." Scenario Outline: Postprocessing: spaces Given we use "html" bowler When the input string is And the execute method is called on bowler Then the result should equal to Examples: | input | output | | "here «quote» goes" | "here «quote» goes" | | "here « quote¹http://wikipedia.org » goes" | "here «quote» goes" | | "This is λsystem.dllλ file." | "This is system.dll file." | | "This is ✓8:35✓ time." | "This is 8:35 time." | Scenario: Video embedded Given we use "html" bowler When the input string is """ http://qipowl.herokuapp.com/images/owl.png ☞ Video embedded: http://www.youtube.com/watch?v=KFKxlYNfT_o """ And the execute method is called on bowler Then the result should equal to """ Video embedded: """
Nested blockquote first" And the result should match "
Blockquote standalone.
here «quote» goes
This is system.dll file.
system.dll
This is 8:35 time.
Video embedded: