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