We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c469ae commit d88cac9Copy full SHA for d88cac9
src/lib/helpers/http.js
@@ -95,5 +95,12 @@ export function replaceNewLine(text) {
95
* @returns string
96
*/
97
export function replaceMarkdown(text) {
98
- return text.replace(/#([\s]*)/g, '\\# ').replace(/\*([\s]*)/g, '\\* ');
+ let res = text.replace(/#([\s]+)/g, '\\# ');
99
+
100
+ let regex = new RegExp('\\*(.*?)\\*', 'g');
101
+ if (!regex.test(text)) {
102
+ res = res.replace(/\*([\s]*)/g, '\\* ');
103
+ }
104
105
+ return res;
106
}
0 commit comments