mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-13 04:08:29 +01:00
Answer architecture round 1: 2 🔴, 6 🟡 (0 misread); carried JSON read through adf/, one spelling home per element in html/, block readers in one table, the first paragraph's form shared, a lint boundary for html/parse, a strictness oracle
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// The element each mark but a link writes around text, holding no attribute; a link writes `<a>`.
|
||||
const markElements: ReadonlyMap<string, string> = new Map([
|
||||
['code', 'code'],
|
||||
['em', 'em'],
|
||||
['strong', 'strong'],
|
||||
])
|
||||
|
||||
export function elementOfMark(type: string): string | undefined {
|
||||
return markElements.get(type)
|
||||
}
|
||||
|
||||
export function markOfElement(name: string): string | undefined {
|
||||
for (const [type, element] of markElements) if (element === name) return type
|
||||
return undefined
|
||||
}
|
||||
Reference in New Issue
Block a user