4f2eac88aa
We need to generate a span when the header's ID doesn't match the one MediaWiki would generate automatically. But MediaWiki's generation scheme is different from ours (it uses uppercase letters, and `_` instead of `-`, for example). This means that in going from markdown -> mediawiki, we'll now get spans before almost every heading, unless explicit identifiers are used that correspond to the ones MediaWiki auto-generates. This is uglier output but it's necessary for internal links to work properly. See #7697.
27 lines
405 B
Markdown
27 lines
405 B
Markdown
```
|
|
% pandoc -f rst -t mediawiki
|
|
.. _refsubpage1:
|
|
|
|
heading
|
|
-------
|
|
|
|
ref to top of this section: `refsubpage1`_.
|
|
^D
|
|
<span id="refsubpage1"></span>
|
|
= heading =
|
|
|
|
ref to top of this section: [[#refsubpage1|refsubpage1]].
|
|
```
|
|
```
|
|
% pandoc -f markdown -t mediawiki
|
|
# Heading {#foo}
|
|
^D
|
|
<span id="foo"></span>
|
|
= Heading =
|
|
```
|
|
```
|
|
% pandoc -f markdown -t mediawiki
|
|
# My Heading {#My_Heading}
|
|
^D
|
|
= My Heading =
|
|
```
|