Skip to content

Commit

Permalink
fixup! Markdown reader: support GitHub wiki's internal links (jgm#2923)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackheaven committed Jun 29, 2020
1 parent a14c11d commit b328b46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Text/Pandoc/Extensions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ data Extension =
| Ext_literate_haskell -- ^ Enable literate Haskell conventions
| Ext_markdown_attribute -- ^ Interpret text inside HTML as markdown iff
-- container has attribute 'markdown'
| Ext_wikilink -- ^ Interpret a markdown wiki link
| Ext_wikilinks -- ^ Interpret a markdown wiki link
| Ext_markdown_in_html_blocks -- ^ Interpret as markdown inside HTML blocks
| Ext_mmd_header_identifiers -- ^ Multimarkdown style header identifiers [myid]
| Ext_mmd_link_attributes -- ^ MMD style reference link attributes
Expand Down Expand Up @@ -258,7 +258,7 @@ githubMarkdownExtensions = extensionsFromList
, Ext_emoji
, Ext_lists_without_preceding_blankline
, Ext_shortcut_reference_links
, Ext_wikilink
, Ext_wikilinks
]

-- | Extensions to be used with multimarkdown.
Expand Down Expand Up @@ -402,7 +402,7 @@ getAllExtensions f = universalExtensions <> getAll f
, Ext_tex_math_single_backslash
, Ext_tex_math_double_backslash
, Ext_markdown_attribute
, Ext_wikilink
, Ext_wikilinks
, Ext_mmd_title_block
, Ext_abbreviations
, Ext_autolink_bare_uris
Expand Down
4 changes: 2 additions & 2 deletions src/Text/Pandoc/Readers/Markdown.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,6 @@ inlines1 = mconcat <$> many1 inline

inline :: PandocMonad m => MarkdownParser m (F Inlines)
inline = choice [ whitespace
, githubWikiLink
, bareURL
, str
, endline
Expand All @@ -1451,6 +1450,7 @@ inline = choice [ whitespace
, note
, cite
, bracketedSpan
, githubWikiLink
, link
, image
, math
Expand Down Expand Up @@ -1740,7 +1740,7 @@ linkTitle = quotedTitle '"' <|> quotedTitle '\''
-- syntax documented under https://help.github.com/en/github/building-a-strong-community/editing-wiki-content
githubWikiLink :: PandocMonad m => MarkdownParser m (F Inlines)
githubWikiLink = try $ do
guardEnabled Ext_wikilink
guardEnabled Ext_wikilinks
string "[["
contents <- lookAhead $ manyTillChar anyChar (try $ string "]]")
let title = "wikilink"
Expand Down

0 comments on commit b328b46

Please sign in to comment.