Added picture support #11

Open
elland wants to merge 4 commits from pictures into dev
Showing only changes of commit 471de1c68a - Show all commits

View file

@ -1,3 +1,4 @@
{-# LANGUAGE MultilineStrings #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-orphans #-}
@ -18,18 +19,20 @@ main = hspec $ do
describe "minimal" do
it "handles unicode" unicode
it "escapes" escaping
it "images" images
it "maths" math
it "numeric entity" numericEntity
it "monospace" monospace
it "code blocks" codeBlocks
it "anchors" anchor
it "space chars" space
it "bare string" someString
it "emphasis" emphatic
it "monospace" monospace
it "labeled link" labeledLink
it "markdown link" link
it "bird tracks" birdTracks
it "module names" modules
it "quotes" quotes
it "numeric entity" numericEntity
it "ignores nesting" ignoreNesting
describe "Parser" do
@ -42,6 +45,18 @@ main = hspec $ do
-- Tests
------------
images :: Expectation
images = do
"<<image.png>>"
`shouldLexTo` [ (1, 3, Picture "image.png" Nothing)
]
"<<image.png title text>>"
`shouldLexTo` [ (1, 3, Picture "image.png" (Just "title text"))
]
"![alt text](image.png)"
`shouldLexTo` [ (1, 3, Picture "image.png" (Just "alt text"))
]
modules :: Expectation
modules = do
"\"MyModule.Name\""
@ -165,6 +180,18 @@ numericEntity = do
`shouldLexTo` [ (1, 1, NumericEntity 101)
]
codeBlocks :: Expectation
codeBlocks =
"""
@
func call here
@
"""
`shouldLexTo` [ (1, 1, MonospaceOpen)
, (1, 2, Token "\nfunc call here\n")
, (3, 1, MonospaceClose)
]
monospace :: Expectation
monospace =
"@mono@"