mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-19 06:35:44 +01:00
Answer product-owner round 1: 0 🔴, 1 🟡 (0 misread); show how a page restores cell colours, name data-background-color in the cell style refusal
This commit is contained in:
@@ -34,7 +34,7 @@ export function readCellAttributes(pairs: readonly (readonly [string, string])[]
|
||||
const released = name === 'data-background-color' && first?.[0] === 'style'
|
||||
if (first?.[0] !== name && !released) continue
|
||||
const value = released ? releasedBackground.exec(first[1])?.[1] : ownValue(name, first[1])
|
||||
if (value === undefined) return { fault: { code: name === 'data-colwidth' ? 'unsupported-node-shape' : 'unmappable-html', message: `${first[0]} on <${element}> spells no value adfToHtml writes there` } }
|
||||
if (value === undefined) return { fault: { code: name === 'data-colwidth' ? 'unsupported-node-shape' : 'unmappable-html', message: released ? `style on <${element}> holds background-color:, then letters and digits after an optional #, as 0.3.1 wrote it; adfToHtml writes data-background-color` : `${name} on <${element}> spells no value adfToHtml writes there` } }
|
||||
attrs[ownKey(name)] = value
|
||||
rest = rest.slice(1)
|
||||
}
|
||||
|
||||
@@ -745,17 +745,18 @@ const pinnedRefusals: readonly (readonly [string, string])[] = [
|
||||
['<p data-indent-level="0">a</p>\n', 'unmappable-html at /content/0: data-indent-level on <p> holds a whole number from 1 to 6'],
|
||||
['<p data-indent-level="02">a</p>\n', 'unmappable-html at /content/0: data-indent-level on <p> holds a whole number from 1 to 6'],
|
||||
['<p data-indent-level="1.5">a</p>\n', 'unmappable-html at /content/0: data-indent-level on <p> holds a whole number from 1 to 6'],
|
||||
['<p data-indent-level="2" data-align="center">a</p>\n', 'unmappable-html at /content/0: <p> takes one of data-align and data-indent-level, first, before its data-* attributes'],
|
||||
['<p data-indent-level="2" data-align="center">a</p>\n', 'unmappable-html at /content/0: <p> holds at most one of data-align and data-indent-level, as its first attribute'],
|
||||
['<blockquote data-indent-level="2">\n<p>a</p>\n</blockquote>\n', 'unsupported-node-shape at /content/0: <blockquote> takes no data-indent-level attribute'],
|
||||
['<h3 data-indent-level="">a</h3>\n', 'unmappable-html at /content/0: data-indent-level on <h3> holds a whole number from 1 to 6'],
|
||||
['<p data-local-id="p1" data-indent-level="2">a</p>\n', 'unmappable-html at /content/0: <p> takes one of data-align and data-indent-level, first, before its data-* attributes'],
|
||||
['<p data-indent-level="2" data-indent-level="2">a</p>\n', 'unmappable-html at /content/0: <p> takes one of data-align and data-indent-level, first, before its data-* attributes'],
|
||||
['<p data-align="center" data-indent-level="2">a</p>\n', 'unmappable-html at /content/0: <p> takes one of data-align and data-indent-level, first, before its data-* attributes'],
|
||||
['<p data-local-id="p1" data-indent-level="2">a</p>\n', 'unmappable-html at /content/0: <p> holds at most one of data-align and data-indent-level, as its first attribute'],
|
||||
['<p data-indent-level="2" data-indent-level="2">a</p>\n', 'unmappable-html at /content/0: <p> holds at most one of data-align and data-indent-level, as its first attribute'],
|
||||
['<p data-align="center" data-indent-level="2">a</p>\n', 'unmappable-html at /content/0: <p> holds at most one of data-align and data-indent-level, as its first attribute'],
|
||||
['<details class="adf-expand" open="" open="">\n<p>a</p>\n</details>\n', 'unmappable-html at /content/0: <details> takes open="" once, after its other attributes'],
|
||||
['<p>a <span title="color:red">b</span></p>\n', 'unmappable-html at /content/0/content/1: a <span> of the dialect is a carry element, holding class="adf-carry" and then data-adf alone, opens with class="adf-emoji", "adf-mention" or "adf-status", or holds data-text-color alone: found "<span title=\\"color:red\\">"…'],
|
||||
['<p>a <span style="color:red">b</span></p>\n', 'unmappable-html at /content/0/content/1: a <span> of the dialect is a carry element, holding class="adf-carry" and then data-adf alone, opens with class="adf-emoji", "adf-mention" or "adf-status", or holds data-text-color alone: found "<span style=\\"color:red\\">"…'],
|
||||
['<p>a <mark style="background-color:red">b</mark></p>\n', 'unmappable-html at /content/0/content/1: a <mark> of the dialect holds data-background-color alone: found "<mark style=\\"background-"…'],
|
||||
['<table>\n<tbody>\n<tr><td style="background-color:url(x)">a</td></tr>\n</tbody>\n</table>\n', 'unmappable-html at /content/0/content/0/content/0: style on <td> spells no value adfToHtml writes there'],
|
||||
['<table>\n<tbody>\n<tr><td rowspan="x">a</td></tr>\n</tbody>\n</table>\n', 'unmappable-html at /content/0/content/0/content/0: rowspan on <td> spells no value adfToHtml writes there'],
|
||||
['<table>\n<tbody>\n<tr><td style="background-color:url(x)">a</td></tr>\n</tbody>\n</table>\n', 'unmappable-html at /content/0/content/0/content/0: style on <td> holds background-color:, then letters and digits after an optional #, as 0.3.1 wrote it; adfToHtml writes data-background-color'],
|
||||
['<table>\n<tbody>\n<tr><td data-colwidth="1" data-background-color="red">a</td></tr>\n</tbody>\n</table>\n', 'unmappable-html at /content/0/content/0/content/0: <td> takes colspan, rowspan, data-background-color and data-colwidth first, each once and in that order: found data-background-color out of place'],
|
||||
['<p>a <mark>b</mark></p>\n', 'unmappable-html at /content/0/content/1: a <mark> of the dialect holds data-background-color alone: found "<mark>b</mark></p>\\n"'],
|
||||
['<blockquote><p>a</p></blockquote>\n', 'unmappable-html at /content/0: <blockquote> holds </blockquote> straight after it, or a line feed and its first block: found "<p>a</p></blockquote>\\n"'],
|
||||
|
||||
Reference in New Issue
Block a user