mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 15:36:25 +00:00
fix(markdown): don't remove char before #
(#23151)
This commit is contained in:
parent
4b2f4abcb9
commit
9bc12da2a0
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ import { regEx } from './regex';
|
||||||
export function sanitizeMarkdown(markdown: string): string {
|
export function sanitizeMarkdown(markdown: string): string {
|
||||||
let res = markdown;
|
let res = markdown;
|
||||||
// Put a zero width space after every # followed by a digit
|
// 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
|
// Put a zero width space after every @ symbol to prevent unintended hyperlinking
|
||||||
res = res.replace(regEx(/@/g), '@​');
|
res = res.replace(regEx(/@/g), '@​');
|
||||||
res = res.replace(regEx(/(`\[?@)​/g), '$1');
|
res = res.replace(regEx(/(`\[?@)​/g), '$1');
|
||||||
|
|
Loading…
Reference in a new issue