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

(Djot) Incorrect header identifier in nested blocks #83

Closed
Omikhleia opened this issue Jul 24, 2023 · 0 comments · Fixed by #84
Closed

(Djot) Incorrect header identifier in nested blocks #83

Omikhleia opened this issue Jul 24, 2023 · 0 comments · Fixed by #84
Labels
bug Something isn't working
Milestone

Comments

@Omikhleia
Copy link
Owner

Warning about duplicate identifiers errors when a header occurs in a block - e.g. a Blockquote, but more realistically in a Div used for styling -- and then internal links do not point to the correct element.

It's a misunderstanding on how the Djot section AST node behaves: We currently take the identifier to use on the rendered header from the previously seen section, ignoring a possible identifier on the header AST node itself.

However:

  • A section is inserted when a header is found at the document level, and the id is set on the section, not on the header.
  • In nested blocks (e.g. in divs), there's not section wrapped, and the id is set on the header.

Note by the way that with our version of djot.lua, other attributes are always on the header (differing from djot.js and the online Djot playground at the current date)

See also jgm/djot#213 for reference.

@Omikhleia Omikhleia added the bug Something isn't working label Jul 24, 2023
@Omikhleia Omikhleia added this to the 1.4.0 milestone Jul 24, 2023
@Omikhleia Omikhleia changed the title Incorrect header identifier in nested blocks in Djot (Djot) Incorrect header identifier in nested blocks Jul 24, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant