18 lines · 515 B · TypeScript
RawDownload
export const isMarkdownPreviewFile = (path: string): boolean => /\.(?:md|mdx)$/i.test(path); export function setMarkdownTaskChecked(  markdown: string,  markerOffset: number,  checked: boolean,): string {  if (    markerOffset < 0 ||    markdown[markerOffset] !== "[" ||    !/[ xX]/.test(markdown[markerOffset + 1] ?? "") ||    markdown[markerOffset + 2] !== "]"  ) {    return markdown;  }   return `${markdown.slice(0, markerOffset + 1)}${checked ? "x" : " "}${markdown.slice(markerOffset + 2)}`;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t