```
% 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 =
```
