~?=
(Right []))
+ , (parseWiki "\n"
+ ~?=
+ (Right []))
+
, (parseWiki "=heading="
~?=
- (Right [Block (Heading 1 "heading")]))
+ (Right [ Heading 1 "heading" ]))
, (parseWiki "== heading == \n"
~?=
- (Right [Block (Heading 2 "heading")]))
+ (Right [ Heading 2 "heading" ]))
, (parseWiki "===== hello world =====\n"
~?=
- (Right [Block (Heading 5 "hello world")]))
+ (Right [ Heading 5 "hello world" ]))
, (parseWiki "a =not a heading="
~?=
- (Right [Inline (Text "a =not a heading=")]))
+ (Right [ Paragraph [ Text "a =not a heading=" ]
+ ]))
, (parseWiki "=h=\n\n=h="
~?=
- (Right [ Block (Heading 1 "h")
- , Block (Heading 1 "h")
+ (Right [ Heading 1 "h"
+ , Heading 1 "h"
+ ]))
+ , (parseWiki "foo\nbar"
+ ~?=
+ (Right [ Paragraph [ Text "foo"
+ , Text "\n"
+ , Text "bar"
+ ]
]))
-
, (parseWiki "foo\nbar\n\nbaz\n"
~?=
- (Right [ Inline (Text "foo")
- , Inline (Text "\n")
- , Inline (Text "bar")
- , Block EmptyLine
- , Inline (Text "baz")
- , Inline (Text "\n")
+ (Right [ Paragraph [ Text "foo"
+ , Text "\n"
+ , Text "bar"
+ ]
+ , Paragraph [ Text "baz"
+ ]
]))
, (parseWiki "foo\n\n\nbar"
~?=
- (Right [ Inline (Text "foo")
- , Block EmptyLine
- , Inline (Text "bar")
+ (Right [ Paragraph [ Text "foo" ]
+ , Paragraph [ Text "bar" ]
]))
, (parseWiki "foo\n=h="
~?=
- (Right [ Inline (Text "foo")
- , Inline (Text "\n")
- , Block (Heading 1 "h")
+ (Right [ Paragraph [ Text "foo" ]
+ , Heading 1 "h"
]))
, (parseWiki "<!-- comment -->"
, (parseWiki "<!-- comment -->foo"
~?=
- (Right [Inline (Text "foo")]))
+ (Right [ Paragraph [ Text "foo" ]
+ ]))
- , (parseWiki "foo<!-- comment -->"
+ , (parseWiki "bar<!-- comment -->"
~?=
- (Right [Inline (Text "foo")]))
+ (Right [ Paragraph [ Text "bar" ]
+ ]))
, (parseWiki "foo<!-- comment -->bar"
~?=
- (Right [ Inline (Text "foo")
- , Inline (Text "bar")
+ (Right [ Paragraph [ Text "foo"
+ , Text "bar"
+ ]
]))
, (parseWiki "<!-- comment -->=h="
~?=
- (Right [Block (Heading 1 "h")]))
+ (Right [ Heading 1 "h" ]))
, (parseWiki "=h= <!---->"
~?=
- (Right [Block (Heading 1 "h")]))
+ (Right [ Heading 1 "h" ]))
, (parseWiki "<!-- <!-- nested --> comment -->"
~?=
, (parseWiki "[[Page]]"
~?=
- (Right [Inline (PageLink (Just "Page") Nothing Nothing)]))
+ (Right [ Paragraph [ PageLink (Just "Page") Nothing Nothing ]
+ ]))
, (parseWiki "[[Page|Link to \"Page\"]]"
~?=
- (Right [Inline (PageLink (Just "Page") Nothing (Just "Link to \"Page\""))]))
+ (Right [ Paragraph [ PageLink (Just "Page") Nothing (Just "Link to \"Page\"") ]
+ ]))
, (parseWiki "[[Page#foo]]"
~?=
- (Right [Inline (PageLink (Just "Page") (Just "foo") Nothing)]))
+ (Right [ Paragraph [ PageLink (Just "Page") (Just "foo") Nothing ]
+ ]))
, (parseWiki "[[#foo]]"
~?=
- (Right [Inline (PageLink Nothing (Just "foo") Nothing)]))
+ (Right [ Paragraph [ PageLink Nothing (Just "foo") Nothing ]
+ ]))
, (parseWiki "[[Page#foo|Link to \"Page#foo\"]]"
~?=
- (Right [Inline (PageLink (Just "Page") (Just "foo") (Just "Link to \"Page#foo\""))]))
+ (Right [ Paragraph [ PageLink (Just "Page") (Just "foo") (Just "Link to \"Page#foo\"") ]
+ ]))
, (parseWiki "foo [[Bar]] baz"
~?=
- (Right [ Inline (Text "foo ")
- , Inline (PageLink (Just "Bar") Nothing Nothing)
- , Inline (Text " baz")
+ (Right [ Paragraph [ Text "foo "
+ , PageLink (Just "Bar") Nothing Nothing
+ , Text " baz"
+ ]
]))
, (parseWiki "[[Foo]]\n[[Bar]]"
~?=
- (Right [ Inline (PageLink (Just "Foo") Nothing Nothing)
- , Inline (Text "\n")
- , Inline (PageLink (Just "Bar") Nothing Nothing)
+ (Right [ Paragraph [ PageLink (Just "Foo") Nothing Nothing
+ , Text "\n"
+ , PageLink (Just "Bar") Nothing Nothing
+ ]
]))
]