From 992f77c17c4c86b7f4836767457094a3a20cdc65 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 5 Dec 2019 09:54:18 -0800 Subject: Roll back part of of `--shift-heading-level-by` change. With positive heading shifts, starting in 2.8 this option caused metadata titles to be removed and changed to regular headings. This behavior is incompatible with the old behavior of `--base-header-level` and breaks old workflows, so with this commit we are rolling back this change. Now, there is an asymmetry in positive and negative heading level shifts: + With positive shifts, the metadata title stays the same and does not get changed to a heading in the body. + With negative shifts, a heading can be converted into the metadata title. I think this is a desirable combination of features, despite the asymmetry. One might, e.g., want to have a document with level-1 section headigs, but render it to HTML with level-2 headings, retaining the metadata title (which pandoc will render as a level-1 heading with the default template). Closes #5957. Revises #5615. --- test/command/shift-heading-level-by.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/command/shift-heading-level-by.md b/test/command/shift-heading-level-by.md index 1d8b8bdd0..323783f24 100644 --- a/test/command/shift-heading-level-by.md +++ b/test/command/shift-heading-level-by.md @@ -8,9 +8,8 @@ title: My title ## Second ^D -Pandoc (Meta {unMeta = fromList []}) -[Header 1 ("",[],[]) [Str "My",Space,Str "title"] -,Header 2 ("first-heading",[],[]) [Str "First",Space,Str "heading"] +Pandoc (Meta {unMeta = fromList [("title",MetaInlines [Str "My",Space,Str "title"])]}) +[Header 2 ("first-heading",[],[]) [Str "First",Space,Str "heading"] ,Header 3 ("second",[],[]) [Str "Second"]] ``` -- cgit v1.2.3