git.iko.soy/typeable/pandoc
on master help sign in
Changed Markdown writer so that it does not use the single-bracket
39eb8cbfiddlosopher
src/Text/Pandoc/Writers/Markdown.hs+1−1
@@ -176,7 +176,7 @@ inlineToMarkdown (Link txt (Src src tit)) =
176inlineToMarkdown (Link txt (Ref ref)) =
176inlineToMarkdown (Link txt (Ref ref)) =
177 let first = char '[' <> inlineListToMarkdown txt <> char ']'
177 let first = char '[' <> inlineListToMarkdown txt <> char ']'
178 second = if (txt == ref)
178 second = if (txt == ref)
179− then empty
179+ then text "[]"
180 else char '[' <> inlineListToMarkdown ref <> char ']' in
180 else char '[' <> inlineListToMarkdown ref <> char ']' in
181 first <> second
181 first <> second
182inlineToMarkdown (Image alternate (Src source tit)) =
182inlineToMarkdown (Image alternate (Src source tit)) =
tests/writer.markdown+6−6
@@ -531,13 +531,13 @@ Foo [bar][a].
531
531
532With [embedded [brackets]][b].
532With [embedded [brackets]][b].
533
533
534−[b] by itself should be a link.
534+[b][] by itself should be a link.
535
535
536−Indented [once].
536+Indented [once][].
537
537
538−Indented [twice].
538+Indented [twice][].
539
539
540−Indented [thrice].
540+Indented [thrice][].
541
541
542This should [not][] be a link.
542This should [not][] be a link.
543
543
@@ -550,7 +550,7 @@ This should [not][] be a link.
550
550
551 [b]: /url/
551 [b]: /url/
552
552
553−Foo [bar].
553+Foo [bar][].
554
554
555Foo [biz](/url/ "Title with &quot;quote&quot; inside").
555Foo [biz](/url/ "Title with &quot;quote&quot; inside").
556
556
@@ -595,7 +595,7 @@ Auto-links should not occur here: `<http://example.com/>`
595
595
596From "Voyage dans la Lune" by Georges Melies (1902):
596From "Voyage dans la Lune" by Georges Melies (1902):
597
597
598−![lalune]
598+![lalune][]
599
599
600
600
601 [lalune]: lalune.jpg "Voyage dans la Lune"
601 [lalune]: lalune.jpg "Voyage dans la Lune"