Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/pandocPublic

With Pandoc 2.8, attributes are added to the header element instead of its parent when --section-divs is enabled #5965

Open
@yihui

Description

@yihui

I noticed a change in Pandoc 2.8 (which might be from9f984ff), but I'm not sure it is intended. Before 2.8, attributes of a header are added to its parentdiv (orsection) when--section-divs is enabled, such as the class attribute:

$ pandoc -t html4 --section-divs<<<"# Hello {.foo}"<div id="hello" class="section level1 foo"><h1>Hello</h1></div>

With 2.8+, the class attribute is added toh1:

$ pandoc -t html4 --section-divs<<<"# Hello {.foo}"<div id="hello" class="section level1"><h1 class="foo">Hello</h1></div>

(Note that theid attribute is still on thediv instead ofh1, though.)

We have plenty of (R Markdown) applications that depend on the previous behavior, i.e., theclass attribute being added to the parentdiv instead of the header itself. For example, previously we could style a whole section by defining CSS rules for.foo { }. Now these rules are only applied to the header elements. We also have JavaScript applications that rely on this behavior. I wonder if there is a chance to restore the old behavior. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp