-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove some markdown & html syntax in feed and metas plugins
- Loading branch information
1 parent
0455632
commit 3975ee7
Showing
9 changed files
with
55 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import removeMarkdown from "npm:[email protected]"; | ||
|
||
export function plainText(md: string, options?: RemoveMarkdownOptions): string { | ||
return removeMarkdown(md.replaceAll(/\s+/g, " ").trim(), options); | ||
} | ||
|
||
export interface RemoveMarkdownOptions { | ||
/** strip list leaders (default: true) */ | ||
stripListLeaders?: boolean; | ||
|
||
/** char to insert instead of stripped list leaders (default: '') */ | ||
listUnicodeChar?: string; | ||
|
||
/** support GitHub-Flavored Markdown (default: true) */ | ||
gfm?: boolean; | ||
|
||
/** replace images with alt-text, if present (default: true) */ | ||
useImgAltText: boolean; | ||
|
||
abbr?: boolean; | ||
|
||
/** replace links with URLs instead anchor text (default: false) */ | ||
replaceLinksWithURL?: boolean; | ||
htmlTagsToSkip?: string[]; | ||
} |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters