@@ -1188,21 +1188,24 @@ func (u *User) formatCodeBlockText(text string, prefix string, codeBlockBackTick
11881188// Bold & Italic - https://www.markdownguide.org/basic-syntax#bold-and-italic
11891189var boldItalicRegExp = []* regexp.Regexp {
11901190 regexp .MustCompile (`(?:\*\*\*)+?(.+?)(?:\*\*\*)+?` ),
1191- regexp .MustCompile (`(?:\_\_\_)+?(.+?)(?:\_\_\_)+?` ),
1192- regexp .MustCompile (`(?:\_\_\*)+?(.+?)(?:\*\_\_)+?` ),
1193- regexp .MustCompile (`(?:\*\*\_)+?(.+?)(?:\_\*\*)+?` ),
1191+ regexp .MustCompile (`\b (?:\_\_\_)+?(.+?)(?:\_\_\_)+?\b ` ),
1192+ regexp .MustCompile (`\b (?:\_\_\*)+?(.+?)(?:\*\_\_)+?\b ` ),
1193+ regexp .MustCompile (`\b (?:\*\*\_)+?(.+?)(?:\_\*\*)+?\b ` ),
11941194}
11951195
11961196// Bold - https://www.markdownguide.org/basic-syntax#bold
11971197var boldRegExp = []* regexp.Regexp {
11981198 regexp .MustCompile (`(?:\*\*)+?(.+?)(?:\*\*)+?` ),
1199- regexp .MustCompile (`(?:\_\_)+?(.+?)(?:\_\_)+?` ),
1199+ regexp .MustCompile (`\b(?:\_\_)+?(.+?)(?:\_\_)+?\b` ),
1200+ }
1201+ var boldRegExp2 = []* regexp.Regexp {
1202+ regexp .MustCompile (`(?:\*\*)+?(.+?)(?:\*\*)+?` ),
12001203}
12011204
12021205// Italic - https://www.markdownguide.org/basic-syntax#italic
12031206var italicRegExp = []* regexp.Regexp {
1204- regexp .MustCompile (`(?:\*)+?(. +?)(?:\*)+?` ),
1205- regexp .MustCompile (`(?:\_)+?(. +?)(?:\_)+?` ),
1207+ regexp .MustCompile (`(?:\*)+?([^\*] +?)(?:\*)+?` ),
1208+ regexp .MustCompile (`\b (?:\_)+?([^_] +?)(?:\_)+?\b ` ),
12061209}
12071210
12081211func markdown2irc (msg string ) string {
0 commit comments