9f984ff26a
Text.Pandoc.Shared:
+ Remove `Element` type [API change]
+ Remove `makeHierarchicalize` [API change]
+ Add `makeSections` [API change]
+ Export `deLink` [API change]
Now that we have Divs, we can use them to represent the structure
of sections, and we don't need a special Element type.
`makeSections` reorganizes a block list, adding Divs with
class `section` around sections, and adding numbering
if needed.
This change also fixes some longstanding issues recognizing
section structure when the document contains Divs.
Closes #3057, see also #997.
All writers have been changed to use `makeSections`.
Note that in the process we have reverted the change
c1d058aeb1
made in response to #5168, which I'm not completely
sure was a good idea.
Lua modules have also been adjusted accordingly.
Existing lua filters that use `hierarchicalize` will
need to be rewritten to use `make_sections`.
1.7 KiB
1.7 KiB
% pandoc -f native -t docx -o - | pandoc -f docx -t native
[Para [Str "hi"], Para [], Para [], Para [Str "lo"]]
^D
[Para [Str "hi"]
,Para [Str "lo"]]
% pandoc -f native -t docx+empty_paragraphs -o - | pandoc -f docx -t native
[Para [Str "hi"], Para [], Para [], Para [Str "lo"]]
^D
[Para [Str "hi"]
,Para [Str "lo"]]
% pandoc -f native -t docx -o - | pandoc -f docx+empty_paragraphs -t native
[Para [Str "hi"], Para [], Para [], Para [Str "lo"]]
^D
[Para [Str "hi"]
,Para [Str "lo"]]
% pandoc -f native -t docx+empty_paragraphs -o - | pandoc -f docx+empty_paragraphs -t native
[Para [Str "hi"], Para [], Para [], Para [Str "lo"]]
^D
[Para [Str "hi"]
,Para []
,Para []
,Para [Str "lo"]]
% pandoc -f native -t html5
[Para [Str "hi"], Para [], Para [], Para [Str "lo"]]
^D
<p>hi</p>
<p>lo</p>
% pandoc -f native -t html5+empty_paragraphs
[Para [Str "hi"], Para [], Para [], Para [Str "lo"]]
^D
<p>hi</p>
<p></p>
<p></p>
<p>lo</p>
% pandoc -f html+empty_paragraphs -t native
<p>hi</p>
<p></p>
<p></p>
<p>lo</p>
^D
[Para [Str "hi"]
,Para []
,Para []
,Para [Str "lo"]]
% pandoc -f html -t native
<p>hi</p>
<p></p>
<p></p>
<p>lo</p>
^D
[Para [Str "hi"]
,Para [Str "lo"]]
% pandoc -f native -t opendocument+empty_paragraphs
[Para [Str "hi"], Para [], Para [], Para [Str "lo"]]
^D
<text:p text:style-name="Text_20_body">hi</text:p>
<text:p text:style-name="Text_20_body"></text:p>
<text:p text:style-name="Text_20_body"></text:p>
<text:p text:style-name="Text_20_body">lo</text:p>
% pandoc -f native -t opendocument
[Para [Str "hi"], Para [], Para [], Para [Str "lo"]]
^D
<text:p text:style-name="Text_20_body">hi</text:p>
<text:p text:style-name="Text_20_body">lo</text:p>