summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/RST.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-17 16:01:44 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-17 16:01:44 -0700
commitd1444b4ecdd7bc2f3b6180ceb2635d51382c4ab8 (patch)
tree516291b660fd34b98bb1ff825936310c6974ae1f /src/Text/Pandoc/Readers/RST.hs
parentb1f6fb4af5e6df40fe72d6224512f60be082a8cd (diff)
RST reader/writer: support unknown interpreted text roles...
...by parsing them as Span with "role" attributes. This way they can be manipulated in the AST. Closes #3407.
Diffstat (limited to 'src/Text/Pandoc/Readers/RST.hs')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 0f594fe1b..190b065fb 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -1399,10 +1399,8 @@ renderRole contents fmt role attr = case role of
case M.lookup custom customRoles of
Just (newRole, newFmt, newAttr) ->
renderRole contents newFmt newRole newAttr
- Nothing -> do
- pos <- getPosition
- logMessage $ SkippedContent (":" ++ custom ++ ":") pos
- return $ B.str contents -- Undefined role
+ Nothing -> -- undefined role
+ return $ B.spanWith ("",[],[("role",role)]) (B.str contents)
where
titleRef ref = return $ B.str ref -- FIXME: Not a sensible behaviour
rfcLink rfcNo = B.link rfcUrl ("RFC " ++ rfcNo) $ B.str ("RFC " ++ rfcNo)