speced / bikeshed

:bike: A preprocessor for anyone writing specifications that converts source files into actual specs.
https://speced.github.io/bikeshed
Creative Commons Zero v1.0 Universal
1.12k stars 201 forks source link

Bikeshed is adding spaces around ins and del tags which makes things visually weird #1981

Open domenic opened 3 years ago

domenic commented 3 years ago

Input:

<pre class="metadata">
Title: App History API
Shortname: app-history
Repository: WICG/app-history
Inline Github Issues: true
Group: WICG
Status: CG-DRAFT
Level: 1
URL: https://wicg.github.io/app-history/
Boilerplate: omit conformance, omit feedback-header
Editor: Domenic Denicola, Google https://www.google.com/, d@domenic.me, https://domenic.me/
Abstract: The app history API provides a web application-focused way of managing same-origin same-frame history entries and navigations.
!Participate: <a href="https://github.com/WICG/app-history">GitHub WICG/app-history</a> (<a href="https://github.com/WICG/app-history/issues/new">new issue</a>, <a href="https://github.com/WICG/app-history/issues?state=open">open issues</a>)
!Commits: <a href="https://github.com/WICG/app-history/commits/master/spec.bs">GitHub spec.bs commits</a>
Complain About: accidental-2119 yes, missing-example-ids yes
Indent: 2
Default Biblio Status: current
Markup Shorthands: markdown yes
Assume Explicit For: yes
</pre>

<blockquote>
  When the user navigates through a [=browsing context=], e.g. using a browser's back and forward buttons, the user agent must <a spec="HTML">traverse the history by a delta</a> with a delta equivalent to the action specified by the user<del> and</del><ins>,</ins> the browsing context being operated on<ins>, and <i>[=traverse the history by a delta/isUserInitiated=]</i> set to true</ins>.
</blockquote>

Relevant portion of the output:


  <main>
   <blockquote>
     When the user navigates through a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context">browsing context</a>, e.g. using a browser’s back and forward buttons, the user agent must <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/history.html#traverse-the-history-by-a-delta" id="ref-for-traverse-the-history-by-a-delta">traverse the history by a delta</a> with a delta equivalent to the action specified by the user
    <del> and</del>
    <ins>,</ins>
     the browsing context being operated on
    <ins>, and <i><a data-link-type="dfn">isUserInitiated</a></i> set to true</ins>
    . 
   </blockquote>
  </main>

Note the bad spaces it added around the ins and del tags.

nschonni commented 3 years ago

Possibly coming from https://github.com/html5lib/html5lib-python upstream

domenic commented 2 years ago

Ran into this again today.

tabatkins commented 1 year ago

No, it's just that right now my serializer categorizes each tag as either block or inline-level, and this affects how it formats. But ins/del are weird tags that can be used both ways, so I probably need to actually special-case them and treat them as block when they contain a block tag and inline otherwise. This'll require some rewriting of how my serializer logic works.