@@ -35,7 +35,7 @@ import Text.Pandoc.Writers.Shared
35import Text.Pandoc.Options
35import Text.Pandoc.Options
36import Text.Pandoc.Walk (query)
36import Text.Pandoc.Walk (query)
37import Text.Printf ( printf )
37import Text.Printf ( printf )
38−import Data.List ( intercalate, isPrefixOf )
38+import Data.List ( intercalate )
39import Control.Monad.State
39import Control.Monad.State
40import Text.Pandoc.Pretty
40import Text.Pandoc.Pretty
41import Text.Pandoc.Templates ( renderTemplate' )
41import Text.Pandoc.Templates ( renderTemplate' )
@@ -283,14 +283,6 @@ inlineToConTeXt (RawInline "tex" str) = return $ text str
283inlineToConTeXt (RawInline _ _) = return empty
283inlineToConTeXt (RawInline _ _) = return empty
284inlineToConTeXt (LineBreak) = return $ text "\\crlf" <> cr
284inlineToConTeXt (LineBreak) = return $ text "\\crlf" <> cr
285inlineToConTeXt Space = return space
285inlineToConTeXt Space = return space
287−inlineToConTeXt (Link [Str str] (src, tit))
288− | if "mailto:" `isPrefixOf` src
289− then src == escapeURI ("mailto:" ++ str)
290− else src == escapeURI str =
291− inlineToConTeXt (Link
292− [RawInline "context" "\\hyphenatedurl{", Str str, RawInline "context" "}"]
294-- Handle HTML-like internal document references to sections
286-- Handle HTML-like internal document references to sections
295inlineToConTeXt (Link txt (('#' : ref), _)) = do
287inlineToConTeXt (Link txt (('#' : ref), _)) = do
296 opts <- gets stOptions
288 opts <- gets stOptions
@@ -305,6 +297,7 @@ inlineToConTeXt (Link txt (('#' : ref), _)) = do
305 <> brackets (text ref)
297 <> brackets (text ref)
307inlineToConTeXt (Link txt (src, _)) = do
299inlineToConTeXt (Link txt (src, _)) = do
300+ let isAutolink = txt == [Str src]
308 st <- get
301 st <- get
309 let next = stNextRef st
302 let next = stNextRef st
310 put $ st {stNextRef = next + 1}
303 put $ st {stNextRef = next + 1}
@@ -313,8 +306,9 @@ inlineToConTeXt (Link txt (src, _)) = do
313 return $ "\\useURL"
306 return $ "\\useURL"
314 <> brackets (text ref)
307 <> brackets (text ref)
315 <> brackets (text $ escapeStringUsing [('#',"\\#"),('%',"\\%")] src)
308 <> brackets (text $ escapeStringUsing [('#',"\\#"),('%',"\\%")] src)
316− <> brackets empty
311+ else brackets empty <> brackets label)
318 <> "\\from"
312 <> "\\from"
319 <> brackets (text ref)
313 <> brackets (text ref)
320inlineToConTeXt (Image _ (src, _)) = do
314inlineToConTeXt (Image _ (src, _)) = do