Skip to content

pantoken-root / renderers/react-markdown/src / parseAlertMarker

Ֆունկցիա: parseAlertMarker() ​

parseAlertMarker(text): { marker: AlertMarker; rest: string; } | undefined

Բետա

Հայտնաբերել GitHub ահազանգի պիտակ տեքստի սկզբում; վերադարձնել պիտակ և մնացած տեքստը։

Պարամետրեր ​

text ​

string

Վերադարձվող արժեք ​

{ marker: AlertMarker; rest: string; } | undefined

Օրինակ ​

ts
import { parseAlertMarker } from "@pantoken/react-markdown";

parseAlertMarker("[!TIP] Helpful"); // { marker: "TIP", rest: "Helpful" }
parseAlertMarker("Plain text"); // undefined