MCPcopy
hub / github.com/docsifyjs/docsify / paragraphCompiler

Function paragraphCompiler

src/core/render/compiler/paragraph.js:3–15  ·  view source on GitHub ↗
({ renderer })

Source from the content-addressed store, hash-verified

1import { helper as helperTpl } from '../tpl';
2
3export const paragraphCompiler = ({ renderer }) =>
4 (renderer.paragraph = text => {
5 let result;
6 if (/^!>/.test(text)) {
7 result = helperTpl('tip', text);
8 } else if (/^\?>/.test(text)) {
9 result = helperTpl('warn', text);
10 } else {
11 result = `<p>${text}</p>`;
12 }
13
14 return result;
15 });

Callers 1

_initRendererMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…