Skip to content

Commit

Permalink
fix(markdown): don't remove char before # (#23154)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Jul 5, 2023
1 parent 519fe4c commit d3a4d96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { regEx } from './regex';
export function sanitizeMarkdown(markdown: string): string {
let res = markdown;
// Put a zero width space after every # followed by a digit
res = res.replace(regEx(/\W#(\d)/gi), '#​$1');
res = res.replace(regEx(/(\W)#(\d)/gi), '$1#​$2');
// Put a zero width space after every @ symbol to prevent unintended hyperlinking
res = res.replace(regEx(/@/g), '@​');
res = res.replace(regEx(/(`\[?@)​/g), '$1');
Expand Down

0 comments on commit d3a4d96

Please sign in to comment.