| 8 | 8 | |
| 9 | 9 | return [{ |
| 10 | 10 | type: 'lang', |
| 11 | 11 | regex: new RegExp('(`{3})[\\s\\S]*?\\1|(`{1,32}).*?\\12|\\b(?<!_)_(?!_)(.*?)(?<!_)_(?!_)\\b', 'gsg'), |
| 12 | 12 | replace: function(match, codeBlocktripleBackticks, singleOrDoubleBackticks, italicContent) { |
| 13 | 13 | if (codeBlocktripleBackticks || singleOrDoubleBackticks) { |
| 14 | 14 | // If it's aany kind of code block, return it unchanged |
| 15 | 15 | return match; |
| 16 | 16 | } else if (italicContent) { |
| 17 | 17 | // If it's an italic group, apply the replacement |
| 18 | 18 | return `'<em>${' + italicContent} + '</em>`'; |
| 19 | 19 | } |
| 20 | + // If neither condition is met, return the original match |
| 21 | + return match; |
| 20 | 22 | }, |
| 21 | 23 | }]; |
| 22 | 24 | } catch (e) { |