-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CommonMark: add support for wiki links. [API change]
Adds commonmark extensions `wikilinks_title_after_pipe` and `wikilinks_title_before_pipe`. The former enables links of style `[[Name of page|Title]]` and the latter `[[Title|Name of page]]`. Titles are optional in both variants, so this works for both: `[[https://example.org]]`, `[[Name of page]]`. The writer is modified to render links with title `wikilink` as a wikilink if a respective extension is enabled. Pandoc will use `wikilinks_title_after_pipe` if both extensions are enabled. Closes: #2923
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
``` | ||
% pandoc --from commonmark_x+wikilinks_title_after_pipe -t html | ||
[[https://example.org]] | ||
[[https://example.org|title]] | ||
[[name of page]] | ||
[[name of page|title]] | ||
^D | ||
<p><a href="https://example.org" title="wikilink">https://example.org</a></p> | ||
<p><a href="https://example.org" title="wikilink">title</a></p> | ||
<p><a href="name of page" title="wikilink">name of page</a></p> | ||
<p><a href="name of page" title="wikilink">title</a></p> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
``` | ||
% pandoc -f commonmark+wikilinks_title_before_pipe -t html | ||
[[https://example.org]] | ||
[[title|https://example.org]] | ||
[[Name of page]] | ||
[[Title|Name of page]] | ||
^D | ||
<p><a href="https://example.org" title="wikilink">https://example.org</a></p> | ||
<p><a href="https://example.org" title="wikilink">title</a></p> | ||
<p><a href="Name of page" title="wikilink">Name of page</a></p> | ||
<p><a href="Name of page" title="wikilink">Title</a></p> | ||
``` | ||
|
||
# Regular links should still work | ||
|
||
``` | ||
% pandoc -f commonmark+wikilinks_title_before_pipe -t html | ||
[Title](Name%20of%20page) | ||
^D | ||
<p><a href="Name%20of%20page">Title</a></p> | ||
``` | ||
|
||
|