Skip to content

Attributes are passed through in Title when using empty heading#8018

Merged
cderv merged 1 commit intomainfrom
pandoc-title-regex-empty-heading
Jan 3, 2024
Merged

Attributes are passed through in Title when using empty heading#8018
cderv merged 1 commit intomainfrom
pandoc-title-regex-empty-heading

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Dec 22, 2023

Related to #8012 report (solves part of it)

We should consider empty headers with attributes when matching against Pandoc Title regex

Dummy example

---
format: html           
---

## {.empty-header}

Content

## Python slide

```{python}
1 + 1
```

image

It context of revealjs, this is a problem has empty headers can have a meaning (creating a new section without title)

---
format: revealjs           
---

## {.empty-header}

Content

## Python slide

```{python}
1 + 1
```

image

@cderv cderv requested a review from dragonstyle December 22, 2023 20:37
@cderv cderv added this to the v1.4 milestone Dec 22, 2023
Copy link
Collaborator

@dragonstyle dragonstyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I confirmed that Pandoc does parse ## {.foo} as a heading with attributes/classes as you'd expect so we appear to be handling this incorrectly in its current form.

@cderv cderv force-pushed the pandoc-title-regex-empty-heading branch from d9ce737 to ff8199d Compare January 3, 2024 13:57
@cderv cderv merged commit 8c8a55c into main Jan 3, 2024
@cderv cderv deleted the pandoc-title-regex-empty-heading branch January 3, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants