Conversation
michaelficarra
left a comment
There was a problem hiding this comment.
I don't like it, but okay.
@michaelficarra I would be delighted to come at the numbering with a different approach. I also don't like it, at least not the solution I'm proposing. I just couldn't think of anything better. I found a mismatch in the layout as compared to the template reviewing this—figure captions should render below the figure, table captions should render above the table. Commit resolving this incoming. |
Updated to Ecma house style
| if (node.nodeName.split('-')[1] === 'FIGURE') { | ||
| node.firstElementChild?.appendChild(captionElem); | ||
| } else { | ||
| node.childNodes[0].insertBefore(captionElem, node.childNodes[0].firstChild); | ||
| } |
There was a problem hiding this comment.
| if (node.nodeName.split('-')[1] === 'FIGURE') { | |
| node.firstElementChild?.appendChild(captionElem); | |
| } else { | |
| node.childNodes[0].insertBefore(captionElem, node.childNodes[0].firstChild); | |
| } | |
| // Captions go below figures but above tables etc. (per Ecma house style) | |
| if (node.nodeName === 'EMU-FIGURE') { | |
| ele.appendChild(captionElem); | |
| } else { | |
| ele.insertBefore(captionElem, ele.firstChild); | |
| } |
| // Reset figure numbering for each Annex | ||
| if (this.isAnnex && !this.parentClause) { | ||
| spec._figureCounts.figure = 0; | ||
| spec._figureCounts.table = 0; | ||
| spec._figurePrefix = `${number}.`; | ||
| } |
There was a problem hiding this comment.
This breaks the rendering of <emu-xref>, e.g. "The entries in Table 103 are added to Table 6" at B.2.1 Additional Properties of the Global Object becomes "The entries in Table 1 are added to Table 6" rather than "The entries in Table B.1 are added to Table 6".
Updated to Ecma house style.
:with—