mirror of
https://github.com/jgm/pandoc.git
synced 2026-10-29 17:52:33 +08:00
RST reader: better handling for headers with an anchor.
Instead of creating a div containing the header, we put the id directly on the header. This way header promotion will work properly. Closes #4240.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
```
|
||||
% pandoc -f rst -s -t native
|
||||
=====
|
||||
Title
|
||||
=====
|
||||
|
||||
--------
|
||||
Subtitle
|
||||
--------
|
||||
|
||||
header1
|
||||
=======
|
||||
|
||||
header2
|
||||
-------
|
||||
|
||||
.. _id:
|
||||
|
||||
header3
|
||||
~~~~~~~
|
||||
|
||||
.. _id2:
|
||||
.. _id3:
|
||||
|
||||
header4
|
||||
~~~~~~~
|
||||
^D
|
||||
Pandoc (Meta {unMeta = fromList [("subtitle",MetaInlines [Str "Subtitle"]),("title",MetaInlines [Str "Title"])]})
|
||||
[Header 1 ("header1",[],[]) [Str "header1"]
|
||||
,Header 2 ("header2",[],[]) [Str "header2"]
|
||||
,Header 3 ("id",[],[]) [Str "header3"]
|
||||
,Header 3 ("id3",[],[]) [Str "header4",Span ("id2",[],[]) []]]
|
||||
```
|
||||
Reference in New Issue
Block a user