Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heading attributes disappear from hierachical sections #43

Closed
hellux opened this issue Jan 29, 2023 · 3 comments
Closed

Heading attributes disappear from hierachical sections #43

hellux opened this issue Jan 29, 2023 · 3 comments

Comments

@hellux
Copy link
Contributor

hellux commented Jan 29, 2023

{a=b}
# abc

results in

<section id="abc">
<h1>abc</h1>
</section>

instead of

<section a="b" id="abc">
<h1>abc</h1>
</section>

or

<section id="abc">
<h1 a="b">abc</h1>
</section>

The only attribute that does not disappear is the id, if provided it overwrites the id on the section as expected.

Headings within block containers are working as expected:

:::
{a=b}
# abc
:::
<div>
<h1 a="b" id="abc">abc</h1>
</div>
@hellux hellux changed the title Heading attributes disappears from hierachical sections Heading attributes disappear from hierachical sections Jan 29, 2023
jgm added a commit that referenced this issue Jan 30, 2023
when promoting the identifier to the enclosing section.

See #43.
@jgm
Copy link
Owner

jgm commented Jan 30, 2023

I've made a change which restores intended behavior, which is that the id attribute migrates the the section but other attributes stay on the heading.

I don't know if that's the best solution, though. Another approach would be to put all the attributes on the section.

@hellux
Copy link
Contributor Author

hellux commented Jan 30, 2023

Hmm, I would prefer to move all of the attributes to the section. I don't see why the id would be considered special in this case.

It would be kind of similar to how lists and list items are handled, attributes get applied to the list instead of the list item. If we want to let one apply attributes to the heading or list item, it could perhaps be solved similarly in both cases.

@jgm jgm closed this as completed in 47290ce Jan 30, 2023
@jgm
Copy link
Owner

jgm commented Jan 30, 2023

OK, I've done it that way.

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

No branches or pull requests

2 participants