| @@ -153,10 +153,10 @@ | ||
| 153 | 153 | "$1" |
| 154 | 154 | ); |
| 155 | 155 | if (br) { |
| 156 | 156 | text = text.replace( |
| 157 | - /<(script|style).*?<\/\\1>/g, | |
| 158 | - (match) => match[0].replace(/\n/g, "<WPPreserveNewline />") | |
| 157 | + /<(script|style|svg|math)[\s\S]*?<\/\1>/g, | |
| 158 | + (match) => match.replace(/\n/g, "<WPPreserveNewline />") | |
| 159 | 159 | ); |
| 160 | 160 | text = text.replace(/<br>|<br\/>/g, "<br />"); |
| 161 | 161 | text = text.replace( |
| 162 | 162 | /(<br \/>)?\s*\n/g, |