File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,13 @@ contentToWikiPage' title contents converter defaultFormat =
104104 doc = reader $ toString b
105105 Pandoc _ blocks = sanitizePandoc $ addWikiLinks doc
106106 convertWikiLinks :: Inline -> Inline
107- convertWikiLinks (Link ref (" " , " " )) = Link ref (converter ref, " " )
107+ convertWikiLinks (Link ref (" " , " " )) = Link (linkTitle ref) (converter ref, " " )
108108 convertWikiLinks (Image ref (" " , " " )) = Image ref (converter ref, " " )
109109 convertWikiLinks x = x
110110
111+ linkTitle [Str refStr] = [Str $ T. unpack $ last . T. splitOn " /" $ T. pack refStr]
112+ linkTitle x = x
113+
111114 addWikiLinks :: Pandoc -> Pandoc
112115 addWikiLinks = bottomUp (convertWikiLinks)
113116
@@ -142,4 +145,3 @@ contentToWikiPage' title contents converter defaultFormat =
142145 sanitizeAttr (x,y) = case sanitizeAttribute (T. pack x, T. pack y) of
143146 Just (w,z) -> Just (T. unpack w, T. unpack z)
144147 Nothing -> Nothing
145-
You can’t perform that action at this time.
0 commit comments