UNPKG

laif-ds

Version:

Design System di Laif con componenti React basati su principi di Atomic Design

35 lines (34 loc) 1.11 kB
"use client"; import { checkQuote as m } from "../util/check-quote.js"; n.peek = v; function n(o, a, t, f) { const u = m(t), l = u === '"' ? "Quote" : "Apostrophe", c = t.enter("image"); let i = t.enter("label"); const e = t.createTracker(f); let r = e.move("!["); return r += e.move( t.safe(o.alt, { before: r, after: "]", ...e.current() }) ), r += e.move("]("), i(), // If there’s no url but there is a title… !o.url && o.title || // 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${l}`), r += e.move(" " + u), r += e.move( t.safe(o.title, { before: r, after: u, ...e.current() }) ), r += e.move(u), i()), r += e.move(")"), c(), r; } function v() { return "!"; } export { n as image };