Skip to content

pantoken / renderers/react-markdown/src / parseAlertMarker

Funkcija: parseAlertMarker()

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

Beta

Zazna oznako opozorila GitHub na začetku besedila; vrne označevalec in preostalo besedilo.

Parametri

text

string

Vrne

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

Primer

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

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