| 8 | | 8 | |
| 9 | return [{ | 9 | return [{ |
| 10 | type: 'lang', | 10 | type: 'lang', |
| 11 | regex: /(`{3,})\s*\n[\s\S]*?\n\1(?:\n|$)|(`{1,2}).*?\2|(?<!\S)_(?!_)([^_\n]+?)(?<!_)_(?!\w)/g, | 11 | regex: /(`{3,})\s*\n[\s\S]*?\n\1(?:\n|$)|(`{1,2}).*?\2|(\n`\n[\s\S]*?\n`\n)|(?<!\S)_(?!_)([^_\n]+?)(?<!_)_(?!\w)/g, |
| 12 | replace: function(match, tripleBackticks, singleOrDoubleBackticks, italicContent) { | 12 | replace: function(match, tripleBackticks, singleOrDoubleBackticks, singleBackticksWithLineBreaks, italicContent) { |
| 13 | if (singleOrDoubleBackticks || tripleBackticks) { | 13 | if (singleOrDoubleBackticks || tripleBackticks || singleBackticksWithLineBreaks) { |
| 14 | // If it's backticks, return unchanged | 14 | // If it's any type of backticks, return unchanged |
| 15 | return match; | 15 | return match; |
| 16 | } else if (italicContent) { | 16 | } else if (italicContent) { |
| 17 | // If it's an italic group, apply the replacement | 17 | // If it's an italic group, apply the replacement |