laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
36 lines (35 loc) • 1.07 kB
JavaScript
"use client";
import { checkQuote as l } from "../util/check-quote.js";
function a(o, m, t, n) {
const f = l(t), u = f === '"' ? "Quote" : "Apostrophe", c = t.enter("definition");
let i = t.enter("label");
const e = t.createTracker(n);
let r = e.move("[");
return r += e.move(
t.safe(t.associationId(o), {
before: r,
after: "]",
...e.current()
})
), r += e.move("]: "), i(), // If there’s no url, or…
!o.url || // If there are control characters or whitespace.
/[\0- \u007F]/.test(o.url) ? (i = t.enter("destinationLiteral"), r += e.move("<"), r += e.move(
t.safe(o.url, { before: r, after: ">", ...e.current() })
), r += e.move(">")) : (i = t.enter("destinationRaw"), r += e.move(
t.safe(o.url, {
before: r,
after: o.title ? " " : `
`,
...e.current()
})
)), i(), o.title && (i = t.enter(`title${u}`), r += e.move(" " + f), r += e.move(
t.safe(o.title, {
before: r,
after: f,
...e.current()
})
), r += e.move(f), i()), c(), r;
}
export {
a as definition
};