aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Readers/HTML.hs.orig
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-05-11 16:51:55 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-05-11 17:10:32 -0700
commita00ca6f0d8e83821d9be910f1eebf3d3cdd1170f (patch)
tree3445409e6a4c854dfdd6ab8c6fdae7f3d30b3de3 /test/Tests/Readers/HTML.hs.orig
parent9b92993a0adab2eefb07aa63b4104437f9c709c1 (diff)
downloadpandoc-a00ca6f0d8e83821d9be910f1eebf3d3cdd1170f.tar.gz
Removed inadvertently added .orig files from repository.
These were added by https://github.com/schrieveslaach/pandoc/commit/96d10c72cc95e56c9e49db3e6db7118e89d1f1e0 Closes #4648.
Diffstat (limited to 'test/Tests/Readers/HTML.hs.orig')
-rw-r--r--test/Tests/Readers/HTML.hs.orig54
1 files changed, 0 insertions, 54 deletions
diff --git a/test/Tests/Readers/HTML.hs.orig b/test/Tests/Readers/HTML.hs.orig
deleted file mode 100644
index 70f33d2b2..000000000
--- a/test/Tests/Readers/HTML.hs.orig
+++ /dev/null
@@ -1,54 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-module Tests.Readers.HTML (tests) where
-
-import Data.Text (Text)
-import Test.Tasty
-import Tests.Helpers
-import Text.Pandoc
-import Text.Pandoc.Arbitrary ()
-import Text.Pandoc.Builder
-
-html :: Text -> Pandoc
-html = purely $ readHtml def
-
-htmlNativeDivs :: Text -> Pandoc
-htmlNativeDivs = purely $ readHtml def { readerExtensions = enableExtension Ext_native_divs $ readerExtensions def }
-
-tests :: [TestTree]
-tests = [ testGroup "base tag"
- [ test html "simple" $
- "<head><base href=\"http://www.w3schools.com/images/foo\" ></head><body><img src=\"stickman.gif\" alt=\"Stickman\"></head>" =?>
- plain (image "http://www.w3schools.com/images/stickman.gif" "" (text "Stickman"))
- , test html "slash at end of base" $
- "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"stickman.gif\" alt=\"Stickman\"></head>" =?>
- plain (image "http://www.w3schools.com/images/stickman.gif" "" (text "Stickman"))
- , test html "slash at beginning of href" $
- "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"/stickman.gif\" alt=\"Stickman\"></head>" =?>
- plain (image "http://www.w3schools.com/stickman.gif" "" (text "Stickman"))
- , test html "absolute URL" $
- "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"http://example.com/stickman.gif\" alt=\"Stickman\"></head>" =?>
- plain (image "http://example.com/stickman.gif" "" (text "Stickman"))
- ]
- , testGroup "anchors"
- [ test html "anchor without href" $ "<a name=\"anchor\"/>" =?>
- plain (spanWith ("anchor",[],[]) mempty)
- ]
- , testGroup "lang"
- [ test html "lang on <html>" $ "<html lang=\"es\">hola" =?>
- setMeta "lang" (text "es") (doc (plain (text "hola")))
- , test html "xml:lang on <html>" $ "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"es\"><head></head><body>hola</body></html>" =?>
- setMeta "lang" (text "es") (doc (plain (text "hola")))
- ]
- , testGroup "main"
- [ test htmlNativeDivs "<main> becomes <div role=main>" $ "<main>hello</main>" =?>
- doc (divWith ("", [], [("role", "main")]) (plain (text "hello")))
- , test htmlNativeDivs "<main role=X> becomes <div role=X>" $ "<main role=foobar>hello</main>" =?>
- doc (divWith ("", [], [("role", "foobar")]) (plain (text "hello")))
- , test htmlNativeDivs "<main> has attributes preserved" $ "<main id=foo class=bar data-baz=qux>hello</main>" =?>
- doc (divWith ("foo", ["bar"], [("role", "main"), ("data-baz", "qux")]) (plain (text "hello")))
- , test htmlNativeDivs "<main> closes <p>" $ "<p>hello<main>main content</main>" =?>
- doc (para (text "hello") <> divWith ("", [], [("role", "main")]) (plain (text "main content")))
- , test htmlNativeDivs "<main> followed by text" $ "<main>main content</main>non-main content" =?>
- doc (divWith ("", [], [("role", "main")]) (plain (text "main content")) <> plain (text "non-main content"))
- ]
- ]