MCPcopy
hub / github.com/freshframework/fresh / blockquote

Method blockquote

www/utils/markdown.ts:249–270  ·  view source on GitHub ↗
({ text, tokens }: Marked.Tokens.Blockquote)

Source from the content-addressed store, hash-verified

247 }
248
249 override blockquote({ text, tokens }: Marked.Tokens.Blockquote): string {
250 const match = text.match(ADMISSION_REG);
251
252 if (match) {
253 const label: Record<string, string> = {
254 tip: "Tip",
255 warn: "Warning",
256 info: "Info",
257 };
258 Marked.walkTokens(tokens, (token) => {
259 if (token.type === "text" && token.text.startsWith(match[0])) {
260 token.text = token.text.slice(match[0].length);
261 }
262 });
263 const type = match[1];
264 const icon = `<svg class="icon"><use href="/icons.svg#${type}" /></svg>`;
265 return `<blockquote class="admonition ${type}">\n<span class="admonition-header">${icon}${
266 label[type]
267 }</span>${this.parser.parse(tokens)}</blockquote>\n`;
268 }
269 return `<blockquote>\n${this.parser.parse(tokens)}</blockquote>\n`;
270 }
271
272 #assert(expr: unknown, msg: string): asserts expr {
273 if (!expr) throw new Error(msg);

Callers

nothing calls this directly

Calls 1

matchMethod · 0.65

Tested by

no test coverage detected