Muse reader: parse "~~" as non-breaking space in Emacs mode
This commit is contained in:
parent
a1378ed76b
commit
c2993a6fc6
2 changed files with 10 additions and 0 deletions
|
@ -581,6 +581,7 @@ inlineList = [ endline
|
|||
, subscriptTag
|
||||
, strikeoutTag
|
||||
, verbatimTag
|
||||
, nbsp
|
||||
, link
|
||||
, code
|
||||
, codeTag
|
||||
|
@ -682,6 +683,12 @@ verbatimTag = do
|
|||
content <- parseHtmlContent "verbatim" anyChar
|
||||
return $ return $ B.text content
|
||||
|
||||
nbsp :: PandocMonad m => MuseParser m (F Inlines)
|
||||
nbsp = do
|
||||
guardDisabled Ext_amuse -- Supported only by Emacs Muse
|
||||
string "~~"
|
||||
return $ return $ B.str "\160"
|
||||
|
||||
code :: PandocMonad m => MuseParser m (F Inlines)
|
||||
code = try $ do
|
||||
pos <- getPosition
|
||||
|
|
|
@ -105,6 +105,9 @@ tests =
|
|||
|
||||
, "Linebreak" =: "Line <br> break" =?> para ("Line" <> linebreak <> "break")
|
||||
|
||||
, test emacsMuse "Non-breaking space"
|
||||
("Foo~~bar" =?> para ("Foo\160bar"))
|
||||
|
||||
, testGroup "Code markup"
|
||||
[ "Code" =: "=foo(bar)=" =?> para (code "foo(bar)")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue