Skip to content

pantoken / renderers/react-markdown/src / parseAlertMarker

Swyddogaeth: parseAlertMarker()

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

Bêta

Canfod marcyn rhybudd GitHub ar ddechrau'r testun; yn dychwelyd y marcyn a gweddill y testun.

Paramedrau

text

string

Yn dychwelyd

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

Enghraifft

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

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