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

Structured headers don't seem to support <ins> #350

Closed
rbuckton opened this issue Aug 22, 2021 · 6 comments · Fixed by #359
Closed

Structured headers don't seem to support <ins> #350

rbuckton opened this issue Aug 22, 2021 · 6 comments · Fixed by #359

Comments

@rbuckton
Copy link
Contributor

I tried using structured headers in https://github.com/tc30/proposal-explicit-resource-management and this was the result:

image

The source text is this:

    <emu-clause id="sec-environment-record-operations-adddisposableresource-env-v-hint" type="abstract operation">
      <h1>
      <ins>
        AddDisposableResource (
          _env_ : a declarative Environment Record,
          _V_ : an ECMAScript language value,
          _hint_ : either ~sync~ or ~async~,
        )
      </ins>
      </h1>
      <dl class="header"></dl>
      <emu-alg>
        1. If _V_ is *null* or *undefined*, return NormalCompletion(~empty~).
        1. Let _resource_ be ? CreateDisposableResource(_V_, _hint_).
        1. Append _resource_ to _env_.[[ResourceStack]].
        1. Return NormalCompletion(~empty~).
      </emu-alg>
    </emu-clause>

Is there another way I am supposed to annotate insertions?

@js-choi
Copy link

js-choi commented Aug 22, 2021

For what it’s worth, I ran into this too with the BigInt Math proposal spec, so it currently uses <ins> on abstract operations’ whole sections, rather than just their headings. It’d be great if <ins> could work on their headings only.

@rbuckton
Copy link
Contributor Author

My workaround was to add an h1.ins class, though it highlights the whole section and doesn't show as an inserted section in the TOC.

@rbuckton
Copy link
Contributor Author

Wrapping <ins> around the algorithm name highlights only the name, but sets the aoid to <ins>...</ins> and also adds an <ins> to the generated paragraph.

Wrapping a parameter with <ins> (to indicate a new parameter) makes the parameter disappear from the clause.

@rbuckton
Copy link
Contributor Author

I tried using <ins class="block"> around the section as @js-choi suggested, but it also causes the section entry in the TOC to no longer be marked as an insertion.

@js-choi
Copy link

js-choi commented Aug 23, 2021

Ah, yes, unfortunately that is also true; no <ins> appears in the table of contents.

@bakkot
Copy link
Contributor

bakkot commented Sep 14, 2021

Sorry about that! Fixed in v9.2.0, which I've just published. The thing you originally tried should now work, including marking it correctly in the TOC. Let me know if there's any place it does not behave as you expect.

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 a pull request may close this issue.

3 participants