Latex reader: Skip spaces in image options
This commit is contained in:
parent
d73fdbf895
commit
9046dbadb1
2 changed files with 5 additions and 0 deletions
|
@ -758,8 +758,10 @@ keyval = try $ do
|
|||
Tok _ Word key <- satisfyTok isWordTok
|
||||
let isSpecSym (Tok _ Symbol t) = t `elem` [".",":","-","|","\\"]
|
||||
isSpecSym _ = False
|
||||
optional sp
|
||||
val <- option [] $ do
|
||||
symbol '='
|
||||
optional sp
|
||||
braced <|> (many1 (satisfyTok isWordTok <|> satisfyTok isSpecSym
|
||||
<|> anyControlSeq))
|
||||
optional sp
|
||||
|
|
|
@ -130,6 +130,9 @@ tests = [ testGroup "basic"
|
|||
, "Image width relative to textsize" =:
|
||||
"\\includegraphics[width=0.6\\textwidth]{foo.png}" =?>
|
||||
para (imageWith ("", [], [("width", "60%")]) "foo.png" "" "image")
|
||||
, "Image with options with spaces" =:
|
||||
"\\includegraphics[width=12cm, height = 5cm]{foo.png}" =?>
|
||||
para (imageWith ("", [], [("width", "12cm"), ("height", "5cm")]) "foo.png" "" "image")
|
||||
]
|
||||
|
||||
, let hex = ['0'..'9']++['a'..'f'] in
|
||||
|
|
Loading…
Add table
Reference in a new issue