mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-20 23:25:43 +01:00
Answer prose round 1: 0 🔴, 13 🟡 (0 misread); define markup characters once, state when empty values and carriage returns ride, and fix the comments and test names
This commit is contained in:
@@ -21,7 +21,7 @@ const characterDelimiters: ReadonlyMap<string, string> = new Map([['em', '_'], [
|
||||
const spellableUrl = /^[^\s[\]{}|\\]+$/
|
||||
const spellableColour = /^#[0-9a-f]{6}$/i
|
||||
|
||||
// spec/wiki.md, Inline and Marks: the nodes, each run of marked nodes, and the carry around what wiki markup cannot spell.
|
||||
// spec/wiki.md, Inline and Marks.
|
||||
export function inlineLine(nodes: readonly AdfNode[], path: ConvertErrorPath): Result<Line> {
|
||||
const atoms = nodes.map((node, index) => atom(node, nodes, index))
|
||||
const groups = markedGroups(atoms)
|
||||
@@ -88,7 +88,6 @@ function hrefSpelling(node: AdfNode, nodes: readonly AdfNode[], index: number):
|
||||
return sharesLink(nodes[index - 1]) || sharesLink(nodes[index + 1]) ? undefined : `[${href}]`
|
||||
}
|
||||
|
||||
// `undefined` where wiki markup has no spelling for the mark.
|
||||
function markDelimiters(mark: AdfMark): Delimiters | undefined {
|
||||
const attrs = nodeAttrs(mark)
|
||||
const character = characterDelimiters.get(mark.type)
|
||||
|
||||
Reference in New Issue
Block a user