Don't put the text of an autolink in Code font.

This commit is contained in:
John MacFarlane 2013-01-06 20:51:51 -08:00
parent 300f8528da
commit 8c48bd8feb
31 changed files with 74 additions and 65 deletions

View file

@ -877,15 +877,15 @@ parseInline (Elem e) =
"varargs" -> return $ code "(...)" "varargs" -> return $ code "(...)"
"xref" -> return $ str "?" -- so at least you know something is there "xref" -> return $ str "?" -- so at least you know something is there
"email" -> return $ link ("mailto:" ++ strContent e) "" "email" -> return $ link ("mailto:" ++ strContent e) ""
$ code $ strContent e $ str $ strContent e
"uri" -> return $ link (strContent e) "" $ code $ strContent e "uri" -> return $ link (strContent e) "" $ str $ strContent e
"ulink" -> link (attrValue "url" e) "" <$> innerInlines "ulink" -> link (attrValue "url" e) "" <$> innerInlines
"link" -> do "link" -> do
ils <- innerInlines ils <- innerInlines
let href = case findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e of let href = case findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e of
Just h -> h Just h -> h
_ -> ('#' : attrValue "linkend" e) _ -> ('#' : attrValue "linkend" e)
let ils' = if ils == mempty then code href else ils let ils' = if ils == mempty then str href else ils
return $ link href "" ils' return $ link href "" ils'
"foreignphrase" -> emph <$> innerInlines "foreignphrase" -> emph <$> innerInlines
"emphasis" -> case attrValue "role" e of "emphasis" -> case attrValue "role" e of

View file

@ -426,7 +426,7 @@ inlineCommands = M.fromList $
, ("lstinline", doverb) , ("lstinline", doverb)
, ("texttt", (code . stringify . toList) <$> tok) , ("texttt", (code . stringify . toList) <$> tok)
, ("url", (unescapeURL <$> braced) >>= \url -> , ("url", (unescapeURL <$> braced) >>= \url ->
pure (link url "" (codeWith ("",["url"],[]) url))) pure (link url "" (str url)))
, ("href", (unescapeURL <$> braced <* optional sp) >>= \url -> , ("href", (unescapeURL <$> braced <* optional sp) >>= \url ->
tok >>= \lab -> tok >>= \lab ->
pure (link url "" lab)) pure (link url "" lab))

View file

@ -1519,14 +1519,14 @@ bareURL :: MarkdownParser (F Inlines)
bareURL = try $ do bareURL = try $ do
guardEnabled Ext_autolink_urls guardEnabled Ext_autolink_urls
(orig, src) <- uri <|> emailAddress (orig, src) <- uri <|> emailAddress
return $ return $ B.link src "" (B.codeWith ("",["url"],[]) orig) return $ return $ B.link src "" (B.str orig)
autoLink :: MarkdownParser (F Inlines) autoLink :: MarkdownParser (F Inlines)
autoLink = try $ do autoLink = try $ do
char '<' char '<'
(orig, src) <- uri <|> emailAddress (orig, src) <- uri <|> emailAddress
char '>' char '>'
return $ return $ B.link src "" (B.codeWith ("",["url"],[]) orig) return $ return $ B.link src "" (B.str orig)
image :: MarkdownParser (F Inlines) image :: MarkdownParser (F Inlines)
image = try $ do image = try $ do

View file

@ -343,8 +343,8 @@ inlineToAsciiDoc opts (Link txt (src, _tit)) = do
else empty else empty
let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
let useAuto = case txt of let useAuto = case txt of
[Code _ s] | s == srcSuffix -> True [Str s] | escapeURI s == srcSuffix -> True
_ -> False _ -> False
return $ if useAuto return $ if useAuto
then text srcSuffix then text srcSuffix
else prefix <> text src <> "[" <> linktext <> "]" else prefix <> text src <> "[" <> linktext <> "]"

View file

@ -34,7 +34,7 @@ import Text.Pandoc.Shared
import Text.Pandoc.Options import Text.Pandoc.Options
import Text.Pandoc.Generic (queryWith) import Text.Pandoc.Generic (queryWith)
import Text.Printf ( printf ) import Text.Printf ( printf )
import Data.List ( intercalate ) import Data.List ( intercalate, isPrefixOf )
import Control.Monad.State import Control.Monad.State
import Text.Pandoc.Pretty import Text.Pandoc.Pretty
import Text.Pandoc.Templates ( renderTemplate ) import Text.Pandoc.Templates ( renderTemplate )
@ -280,7 +280,11 @@ inlineToConTeXt (RawInline _ _) = return empty
inlineToConTeXt (LineBreak) = return $ text "\\crlf" <> cr inlineToConTeXt (LineBreak) = return $ text "\\crlf" <> cr
inlineToConTeXt Space = return space inlineToConTeXt Space = return space
-- autolink -- autolink
inlineToConTeXt (Link [Code _ str] (src, tit)) = inlineToConTeXt (Link inlineToConTeXt (Link [Str str] (src, tit))
| if "mailto:" `isPrefixOf` src
then src == escapeURI ("mailto:" ++ str)
else src == escapeURI str =
inlineToConTeXt (Link
[RawInline "context" "\\hyphenatedurl{", Str str, RawInline "context" "}"] [RawInline "context" "\\hyphenatedurl{", Str str, RawInline "context" "}"]
(src, tit)) (src, tit))
-- Handle HTML-like internal document references to sections -- Handle HTML-like internal document references to sections

View file

@ -289,7 +289,7 @@ inlineToDocbook opts (Link txt (src, _)) =
emailLink = inTagsSimple "email" $ text $ emailLink = inTagsSimple "email" $ text $
escapeStringForXML $ src' escapeStringForXML $ src'
in case txt of in case txt of
[Code _ s] | s == src' -> emailLink [Str s] | escapeURI s == src' -> emailLink
_ -> inlinesToDocbook opts txt <+> _ -> inlinesToDocbook opts txt <+>
char '(' <> emailLink <> char ')' char '(' <> emailLink <> char ')'
else (if isPrefixOf "#" src else (if isPrefixOf "#" src

View file

@ -675,7 +675,9 @@ inlineToHtml opts inline =
_ -> return mempty _ -> return mempty
(RawInline "html" str) -> return $ preEscapedString str (RawInline "html" str) -> return $ preEscapedString str
(RawInline _ _) -> return mempty (RawInline _ _) -> return mempty
(Link [Code _ str] (s,_)) | "mailto:" `isPrefixOf` s -> (Link [Str str] (s,_)) | "mailto:" `isPrefixOf` s &&
s == escapeURI ("mailto" ++ str) ->
-- autolink
return $ obfuscateLink opts str s return $ obfuscateLink opts str s
(Link txt (s,_)) | "mailto:" `isPrefixOf` s -> do (Link txt (s,_)) | "mailto:" `isPrefixOf` s -> do
linkText <- inlineListToHtml opts txt linkText <- inlineListToHtml opts txt

View file

@ -593,7 +593,7 @@ inlineToLaTeX (Link txt ('#':ident, _)) = do
return $ text "\\hyperref" <> brackets (text ident') <> braces contents return $ text "\\hyperref" <> brackets (text ident') <> braces contents
inlineToLaTeX (Link txt (src, _)) = inlineToLaTeX (Link txt (src, _)) =
case txt of case txt of
[Code _ x] | x == src -> -- autolink [Str x] | x == src -> -- autolink
do modify $ \s -> s{ stUrl = True } do modify $ \s -> s{ stUrl = True }
src' <- stringToLaTeX True x src' <- stringToLaTeX True x
return $ text $ "\\url{" ++ src' ++ "}" return $ text $ "\\url{" ++ src' ++ "}"

View file

@ -332,8 +332,9 @@ inlineToMan opts (Link txt (src, _)) = do
linktext <- inlineListToMan opts txt linktext <- inlineListToMan opts txt
let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
return $ case txt of return $ case txt of
[Code _ s] [Str s]
| s == srcSuffix -> char '<' <> text srcSuffix <> char '>' | escapeURI s == srcSuffix ->
char '<' <> text srcSuffix <> char '>'
_ -> linktext <> text " (" <> text src <> char ')' _ -> linktext <> text " (" <> text src <> char ')'
inlineToMan opts (Image alternate (source, tit)) = do inlineToMan opts (Image alternate (source, tit)) = do
let txt = if (null alternate) || (alternate == [Str ""]) || let txt = if (null alternate) || (alternate == [Str ""]) ||

View file

@ -630,8 +630,8 @@ inlineToMarkdown opts (Link txt (src, tit)) = do
else text $ " \"" ++ tit ++ "\"" else text $ " \"" ++ tit ++ "\""
let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
let useAuto = case (tit,txt) of let useAuto = case (tit,txt) of
("", [Code _ s]) | s == srcSuffix -> True ("", [Str s]) | escapeURI s == srcSuffix -> True
_ -> False _ -> False
let useRefLinks = writerReferenceLinks opts && not useAuto let useRefLinks = writerReferenceLinks opts && not useAuto
ref <- if useRefLinks then getReference txt (src, tit) else return [] ref <- if useRefLinks then getReference txt (src, tit) else return []
reftext <- inlineListToMarkdown opts ref reftext <- inlineListToMarkdown opts ref

View file

@ -378,7 +378,7 @@ inlineToMediaWiki _ Space = return " "
inlineToMediaWiki opts (Link txt (src, _)) = do inlineToMediaWiki opts (Link txt (src, _)) = do
label <- inlineListToMediaWiki opts txt label <- inlineListToMediaWiki opts txt
case txt of case txt of
[Code _ s] | s == src -> return src [Str s] | escapeURI s == src -> return src
_ -> if isURI src _ -> if isURI src
then return $ "[" ++ src ++ " " ++ label ++ "]" then return $ "[" ++ src ++ " " ++ label ++ "]"
else return $ "[[" ++ src' ++ "|" ++ label ++ "]]" else return $ "[[" ++ src' ++ "|" ++ label ++ "]]"

View file

@ -271,7 +271,7 @@ inlineToOrg (LineBreak) = return cr -- there's no line break in Org
inlineToOrg Space = return space inlineToOrg Space = return space
inlineToOrg (Link txt (src, _)) = do inlineToOrg (Link txt (src, _)) = do
case txt of case txt of
[Code _ x] | x == src -> -- autolink [Str x] | escapeURI x == src -> -- autolink
do modify $ \s -> s{ stLinks = True } do modify $ \s -> s{ stLinks = True }
return $ "[[" <> text x <> "]]" return $ "[[" <> text x <> "]]"
_ -> do contents <- inlineListToOrg txt _ -> do contents <- inlineListToOrg txt

View file

@ -348,8 +348,11 @@ inlineToRST (RawInline "rst" x) = return $ text x
inlineToRST (RawInline _ _) = return empty inlineToRST (RawInline _ _) = return empty
inlineToRST (LineBreak) = return cr -- there's no line break in RST inlineToRST (LineBreak) = return cr -- there's no line break in RST
inlineToRST Space = return space inlineToRST Space = return space
inlineToRST (Link [Code _ str] (src, _)) | src == str || -- autolink
src == "mailto:" ++ str = do inlineToRST (Link [Str str] (src, _))
| if "mailto:" `isPrefixOf` src
then src == escapeURI ("mailto:" ++ str)
else src == escapeURI str = do
let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
return $ text srcSuffix return $ text srcSuffix
inlineToRST (Link [Image alt (imgsrc,imgtit)] (src, _tit)) = do inlineToRST (Link [Image alt (imgsrc,imgtit)] (src, _tit)) = do

View file

@ -425,7 +425,7 @@ inlineToTexinfo (Link txt (src@('#':_), _)) = do
braces (text (stringToTexinfo src) <> text "," <> contents) braces (text (stringToTexinfo src) <> text "," <> contents)
inlineToTexinfo (Link txt (src, _)) = do inlineToTexinfo (Link txt (src, _)) = do
case txt of case txt of
[Code _ x] | x == src -> -- autolink [Str x] | escapeURI x == src -> -- autolink
do return $ text $ "@url{" ++ x ++ "}" do return $ text $ "@url{" ++ x ++ "}"
_ -> do contents <- escapeCommas $ inlineListToTexinfo txt _ -> do contents <- escapeCommas $ inlineListToTexinfo txt
let src1 = stringToTexinfo src let src1 = stringToTexinfo src

View file

@ -915,7 +915,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
<title>Autolinks</title> <title>Autolinks</title>
<para> <para>
With an ampersand: With an ampersand:
<ulink url="http://example.com/?foo=1&amp;bar=2"><literal>http://example.com/?foo=1&amp;bar=2</literal></ulink> <ulink url="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</ulink>
</para> </para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
@ -925,7 +925,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<ulink url="http://example.com/"><literal>http://example.com/</literal></ulink> <ulink url="http://example.com/">http://example.com/</ulink>
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
@ -940,7 +940,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
<blockquote> <blockquote>
<para> <para>
Blockquoted: Blockquoted:
<ulink url="http://example.com/"><literal>http://example.com/</literal></ulink> <ulink url="http://example.com/">http://example.com/</ulink>
</para> </para>
</blockquote> </blockquote>
<para> <para>

View file

@ -227,7 +227,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
,Para [Link [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","")] ,Para [Link [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","")]
,Para [Link [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","")] ,Para [Link [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","")]
,Para [Link [Str "with_underscore"] ("/url/with_underscore","")] ,Para [Link [Str "with_underscore"] ("/url/with_underscore","")]
,Para [Link [Code ("",[],[]) "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] ,Para [Link [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
,Para [Link [Str "Empty"] ("",""),Str "."] ,Para [Link [Str "Empty"] ("",""),Str "."]
,Header 2 [Str "Reference"] ,Header 2 [Str "Reference"]
,Para [Str "Foo",Space,Link [Str "bar"] ("/url/",""),Str "."] ,Para [Str "Foo",Space,Link [Str "bar"] ("/url/",""),Str "."]
@ -248,14 +248,14 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."] ,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."]
,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."] ,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."]
,Header 2 [Str "Autolinks"] ,Header 2 [Str "Autolinks"]
,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link [Code ("",[],[]) "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] ,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")]
,BulletList ,BulletList
[[Para [Str "In",Space,Str "a",Space,Str "list?"]] [[Para [Str "In",Space,Str "a",Space,Str "list?"]]
,[Para [Link [Code ("",[],[]) "http://example.com/"] ("http://example.com/","")]] ,[Para [Link [Str "http://example.com/"] ("http://example.com/","")]]
,[Para [Str "It",Space,Str "should."]]] ,[Para [Str "It",Space,Str "should."]]]
,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link [Code ("",[],[]) "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] ,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
,BlockQuote ,BlockQuote
[Para [Str "Blockquoted:",Space,Link [Code ("",[],[]) "http://example.com/"] ("http://example.com/","")]] [Para [Str "Blockquoted:",Space,Link [Str "http://example.com/"] ("http://example.com/","")]]
,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"] ,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"]
,CodeBlock ("",[],[]) "or here: <http://example.com/>" ,CodeBlock ("",[],[]) "or here: <http://example.com/>"
,Header 1 [Str "Images"] ,Header 1 [Str "Images"]

View file

@ -780,7 +780,7 @@ With an ampersand: \url{http://example.com/?foo=1&bar=2}
It should. It should.
\end{itemize} \end{itemize}
An e-mail address: An e-mail address:
\href{mailto:nobody@nowhere.net}{\texttt{nobody@nowhere.net}} \href{mailto:nobody@nowhere.net}{nobody@nowhere.net}
\begin{quote} \begin{quote}
Blockquoted: \url{http://example.com/} Blockquoted: \url{http://example.com/}

View file

@ -348,14 +348,14 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."] ,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."]
,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."] ,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."]
,Header 2 [Str "Autolinks"] ,Header 2 [Str "Autolinks"]
,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link [Code ("",["url"],[]) "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] ,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")]
,BulletList ,BulletList
[[Para [Str "In",Space,Str "a",Space,Str "list?"]] [[Para [Str "In",Space,Str "a",Space,Str "list?"]]
,[Para [Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]] ,[Para [Link [Str "http://example.com/"] ("http://example.com/","")]]
,[Para [Str "It",Space,Str "should."]]] ,[Para [Str "It",Space,Str "should."]]]
,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link [Code ("",[],[]) "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] ,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
,BlockQuote ,BlockQuote
[Para [Str "Blockquoted:",Space,Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]] [Para [Str "Blockquoted:",Space,Link [Str "http://example.com/"] ("http://example.com/","")]]
,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"] ,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"]
,CodeBlock ("",[],[]) "or here: <http://example.com/>" ,CodeBlock ("",[],[]) "or here: <http://example.com/>"
,HorizontalRule ,HorizontalRule

View file

@ -31,7 +31,7 @@
,Header 2 [Str "Multilingual",Space,Str "URLs"] ,Header 2 [Str "Multilingual",Space,Str "URLs"]
,Para [RawInline "html" "<http://\27979.com?\27979=\27979>"] ,Para [RawInline "html" "<http://\27979.com?\27979=\27979>"]
,Para [Link [Str "foo"] ("/bar/\27979?x=\27979","title")] ,Para [Link [Str "foo"] ("/bar/\27979?x=\27979","title")]
,Para [Link [Code ("",["url"],[]) "\27979@foo.\27979.baz"] ("mailto:\27979@foo.\27979.baz","")] ,Para [Link [Str "\27979@foo.\27979.baz"] ("mailto:\27979@foo.\27979.baz","")]
,Header 2 [Str "Numbered",Space,Str "examples"] ,Header 2 [Str "Numbered",Space,Str "examples"]
,OrderedList (1,Example,TwoParens) ,OrderedList (1,Example,TwoParens)
[[Plain [Str "First",Space,Str "example."]] [[Plain [Str "First",Space,Str "example."]]

View file

@ -371,14 +371,14 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."] ,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."]
,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."] ,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."]
,Header 2 [Str "Autolinks"] ,Header 2 [Str "Autolinks"]
,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link [Code ("",["url"],[]) "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] ,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")]
,BulletList ,BulletList
[[Plain [Str "In",Space,Str "a",Space,Str "list?"]] [[Plain [Str "In",Space,Str "a",Space,Str "list?"]]
,[Plain [Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]] ,[Plain [Link [Str "http://example.com/"] ("http://example.com/","")]]
,[Plain [Str "It",Space,Str "should."]]] ,[Plain [Str "It",Space,Str "should."]]]
,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link [Code ("",["url"],[]) "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] ,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
,BlockQuote ,BlockQuote
[Para [Str "Blockquoted:",Space,Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]] [Para [Str "Blockquoted:",Space,Link [Str "http://example.com/"] ("http://example.com/","")]]
,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"] ,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"]
,CodeBlock ("",[],[]) "or here: <http://example.com/>" ,CodeBlock ("",[],[]) "or here: <http://example.com/>"
,HorizontalRule ,HorizontalRule

View file

@ -1323,7 +1323,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
<title>Autolinks</title> <title>Autolinks</title>
<para> <para>
With an ampersand: With an ampersand:
<ulink url="http://example.com/?foo=1&amp;bar=2"><literal>http://example.com/?foo=1&amp;bar=2</literal></ulink> <ulink url="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</ulink>
</para> </para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
@ -1333,7 +1333,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<ulink url="http://example.com/"><literal>http://example.com/</literal></ulink> <ulink url="http://example.com/">http://example.com/</ulink>
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
@ -1348,7 +1348,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
<blockquote> <blockquote>
<para> <para>
Blockquoted: Blockquoted:
<ulink url="http://example.com/"><literal>http://example.com/</literal></ulink> <ulink url="http://example.com/">http://example.com/</ulink>
</para> </para>
</blockquote> </blockquote>
<para> <para>

File diff suppressed because one or more lines are too long

View file

@ -524,10 +524,10 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>')
<p>Heres an <a href="/script?foo=1&amp;bar=2">inline link</a>.</p> <p>Heres an <a href="/script?foo=1&amp;bar=2">inline link</a>.</p>
<p>Heres an <a href="/script?foo=1&amp;bar=2">inline link in pointy braces</a>.</p> <p>Heres an <a href="/script?foo=1&amp;bar=2">inline link in pointy braces</a>.</p>
<h2 id="autolinks">Autolinks</h2> <h2 id="autolinks">Autolinks</h2>
<p>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2"><code class="url">http://example.com/?foo=1&amp;bar=2</code></a></p> <p>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</a></p>
<ul> <ul>
<li>In a list?</li> <li>In a list?</li>
<li><a href="http://example.com/"><code class="url">http://example.com/</code></a></li> <li><a href="http://example.com/">http://example.com/</a></li>
<li>It should.</li> <li>It should.</li>
</ul> </ul>
<p>An e-mail address: <script type="text/javascript"> <p>An e-mail address: <script type="text/javascript">
@ -537,7 +537,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+
// --> // -->
</script><noscript>&#110;&#x6f;&#98;&#x6f;&#100;&#x79;&#32;&#x61;&#116;&#32;&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#110;&#x65;&#116;</noscript></p> </script><noscript>&#110;&#x6f;&#98;&#x6f;&#100;&#x79;&#32;&#x61;&#116;&#32;&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#110;&#x65;&#116;</noscript></p>
<blockquote> <blockquote>
<p>Blockquoted: <a href="http://example.com/"><code class="url">http://example.com/</code></a></p> <p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p>
</blockquote> </blockquote>
<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p> <p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
<pre><code>or here: &lt;http://example.com/&gt;</code></pre> <pre><code>or here: &lt;http://example.com/&gt;</code></pre>

View file

@ -854,8 +854,7 @@ With an ampersand: \url{http://example.com/?foo=1\&bar=2}
It should. It should.
\end{itemize} \end{itemize}
An e-mail address: An e-mail address: \href{mailto:nobody@nowhere.net}{nobody@nowhere.net}
\href{mailto:nobody@nowhere.net}{\texttt{nobody@nowhere.net}}
\begin{quote} \begin{quote}
Blockquoted: \url{http://example.com/} Blockquoted: \url{http://example.com/}

View file

@ -610,7 +610,7 @@ With an ampersand: http://example.com/?foo=1&bar=2
* http://example.com/ * http://example.com/
* It should. * It should.
An e-mail address: [mailto:nobody@nowhere.net <code>nobody@nowhere.net</code>] An e-mail address: [mailto:nobody@nowhere.net nobody@nowhere.net]
<blockquote>Blockquoted: http://example.com/ <blockquote>Blockquoted: http://example.com/
</blockquote> </blockquote>

View file

@ -371,14 +371,14 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."] ,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."]
,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."] ,Para [Str "Here\8217s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."]
,Header 2 [Str "Autolinks"] ,Header 2 [Str "Autolinks"]
,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link [Code ("",["url"],[]) "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] ,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")]
,BulletList ,BulletList
[[Plain [Str "In",Space,Str "a",Space,Str "list?"]] [[Plain [Str "In",Space,Str "a",Space,Str "list?"]]
,[Plain [Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]] ,[Plain [Link [Str "http://example.com/"] ("http://example.com/","")]]
,[Plain [Str "It",Space,Str "should."]]] ,[Plain [Str "It",Space,Str "should."]]]
,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link [Code ("",["url"],[]) "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] ,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
,BlockQuote ,BlockQuote
[Para [Str "Blockquoted:",Space,Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]] [Para [Str "Blockquoted:",Space,Link [Str "http://example.com/"] ("http://example.com/","")]]
,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"] ,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"]
,CodeBlock ("",[],[]) "or here: <http://example.com/>" ,CodeBlock ("",[],[]) "or here: <http://example.com/>"
,HorizontalRule ,HorizontalRule

View file

@ -1540,22 +1540,22 @@ link</text:span></text:a>.</text:p>
link in pointy braces</text:span></text:a>.</text:p> link in pointy braces</text:span></text:a>.</text:p>
<text:h text:style-name="Heading_20_2" text:outline-level="2">Autolinks</text:h> <text:h text:style-name="Heading_20_2" text:outline-level="2">Autolinks</text:h>
<text:p text:style-name="First_20_paragraph">With an ampersand: <text:p text:style-name="First_20_paragraph">With an ampersand:
<text:a xlink:type="simple" xlink:href="http://example.com/?foo=1&amp;bar=2" office:name=""><text:span text:style-name="Definition"><text:span text:style-name="Teletype">http://example.com/?foo=1&amp;bar=2</text:span></text:span></text:a></text:p> <text:a xlink:type="simple" xlink:href="http://example.com/?foo=1&amp;bar=2" office:name=""><text:span text:style-name="Definition">http://example.com/?foo=1&amp;bar=2</text:span></text:a></text:p>
<text:list text:style-name="L29"> <text:list text:style-name="L29">
<text:list-item> <text:list-item>
<text:p text:style-name="P55">In a list?</text:p> <text:p text:style-name="P55">In a list?</text:p>
</text:list-item> </text:list-item>
<text:list-item> <text:list-item>
<text:p text:style-name="P55"><text:a xlink:type="simple" xlink:href="http://example.com/" office:name=""><text:span text:style-name="Definition"><text:span text:style-name="Teletype">http://example.com/</text:span></text:span></text:a></text:p> <text:p text:style-name="P55"><text:a xlink:type="simple" xlink:href="http://example.com/" office:name=""><text:span text:style-name="Definition">http://example.com/</text:span></text:a></text:p>
</text:list-item> </text:list-item>
<text:list-item> <text:list-item>
<text:p text:style-name="P55">It should.</text:p> <text:p text:style-name="P55">It should.</text:p>
</text:list-item> </text:list-item>
</text:list> </text:list>
<text:p text:style-name="First_20_paragraph">An e-mail address: <text:p text:style-name="First_20_paragraph">An e-mail address:
<text:a xlink:type="simple" xlink:href="mailto:nobody@nowhere.net" office:name=""><text:span text:style-name="Definition"><text:span text:style-name="Teletype">nobody@nowhere.net</text:span></text:span></text:a></text:p> <text:a xlink:type="simple" xlink:href="mailto:nobody@nowhere.net" office:name=""><text:span text:style-name="Definition">nobody@nowhere.net</text:span></text:a></text:p>
<text:p text:style-name="P56">Blockquoted: <text:p text:style-name="P56">Blockquoted:
<text:a xlink:type="simple" xlink:href="http://example.com/" office:name=""><text:span text:style-name="Definition"><text:span text:style-name="Teletype">http://example.com/</text:span></text:span></text:a></text:p> <text:a xlink:type="simple" xlink:href="http://example.com/" office:name=""><text:span text:style-name="Definition">http://example.com/</text:span></text:a></text:p>
<text:p text:style-name="First_20_paragraph">Auto-links should not occur here: <text:p text:style-name="First_20_paragraph">Auto-links should not occur here:
<text:span text:style-name="Teletype">&lt;http://example.com/&gt;</text:span></text:p> <text:span text:style-name="Teletype">&lt;http://example.com/&gt;</text:span></text:p>
<text:p text:style-name="P57">or here: &lt;http://example.com/&gt;</text:p> <text:p text:style-name="P57">or here: &lt;http://example.com/&gt;</text:p>

View file

@ -711,7 +711,7 @@ With an ampersand: [[http://example.com/?foo=1&bar=2]]
- [[http://example.com/]] - [[http://example.com/]]
- It should. - It should.
An e-mail address: [[mailto:nobody@nowhere.net][=nobody@nowhere.net=]] An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
#+BEGIN_QUOTE #+BEGIN_QUOTE
Blockquoted: [[http://example.com/]] Blockquoted: [[http://example.com/]]

View file

@ -407,21 +407,21 @@ inline link in pointy braces
.\par} .\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Autolinks\par} {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Autolinks\par}
{\pard \ql \f0 \sa180 \li0 \fi0 With an ampersand: {\field{\*\fldinst{HYPERLINK "http://example.com/?foo=1&bar=2"}}{\fldrslt{\ul {\pard \ql \f0 \sa180 \li0 \fi0 With an ampersand: {\field{\*\fldinst{HYPERLINK "http://example.com/?foo=1&bar=2"}}{\fldrslt{\ul
{\f1 http://example.com/?foo=1&bar=2} http://example.com/?foo=1&bar=2
}}} }}}
\par} \par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab In a list?\par} {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab In a list?\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\field{\*\fldinst{HYPERLINK "http://example.com/"}}{\fldrslt{\ul {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\field{\*\fldinst{HYPERLINK "http://example.com/"}}{\fldrslt{\ul
{\f1 http://example.com/} http://example.com/
}}} }}}
\par} \par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab It should.\sa180\par} {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab It should.\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 An e-mail address: {\field{\*\fldinst{HYPERLINK "mailto:nobody@nowhere.net"}}{\fldrslt{\ul {\pard \ql \f0 \sa180 \li0 \fi0 An e-mail address: {\field{\*\fldinst{HYPERLINK "mailto:nobody@nowhere.net"}}{\fldrslt{\ul
{\f1 nobody@nowhere.net} nobody@nowhere.net
}}} }}}
\par} \par}
{\pard \ql \f0 \sa180 \li720 \fi0 Blockquoted: {\field{\*\fldinst{HYPERLINK "http://example.com/"}}{\fldrslt{\ul {\pard \ql \f0 \sa180 \li720 \fi0 Blockquoted: {\field{\*\fldinst{HYPERLINK "http://example.com/"}}{\fldrslt{\ul
{\f1 http://example.com/} http://example.com/
}}} }}}
\par} \par}
{\pard \ql \f0 \sa180 \li0 \fi0 Auto-links should not occur here: {\f1 <http://example.com/>}\par} {\pard \ql \f0 \sa180 \li0 \fi0 Auto-links should not occur here: {\f1 <http://example.com/>}\par}

View file

@ -978,7 +978,7 @@ In a list?
It should. It should.
@end itemize @end itemize
An e-mail address: @uref{mailto:nobody@@nowhere.net,@code{nobody@@nowhere.net}} An e-mail address: @uref{mailto:nobody@@nowhere.net,nobody@@nowhere.net}
@quotation @quotation
Blockquoted: @url{http://example.com/} Blockquoted: @url{http://example.com/}

View file

@ -656,7 +656,7 @@ With an ampersand: "$":http://example.com/?foo=1&bar=2
* "$":http://example.com/ * "$":http://example.com/
* It should. * It should.
An e-mail address: "<tt>nobody@nowhere.net</tt>":mailto:nobody@nowhere.net An e-mail address: "nobody&#64;nowhere.net":mailto:nobody@nowhere.net
bq. Blockquoted: "$":http://example.com/ bq. Blockquoted: "$":http://example.com/