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