Created
October 5, 2025 21:39
-
-
Save StartAutomating/3c2b9bb95644d316618833c7675b2846 to your computer and use it in GitHub Desktop.
Revisions
-
StartAutomating created this gist
Oct 5, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ filter looksLikeMarkdown { if ( # If it's got a markdown-like link $_ -match '\[[^\]]+\]\(' -or # Or any of the lines start with markdown special characters $_ -split '(?>\r\n|\n)' -match '\s{0,3}[\#*~`]' ) { # it's probably markdown $_ } } # does not look like markdown "hello" | looksLikeMarkdown # does not look like markdown "<h1>hello world</h1>" | looksLikeMarkdown # Everything from here on down looks like markdown "[hello world](https://example.com)" | looksLikeMarkdown "# hello world" | looksLikeMarkdown "* one thing" | looksLikeMarkdown "~~~PowerShell 'hello world' ~~~" | looksLikeMarkdown