Skip to content
Snippets Groups Projects
Verified Commit 4ee63fb8 authored by victor mutai's avatar victor mutai
Browse files

chore: use regex to test for ordered list

parent 5ee3ab11
No related branches found
No related tags found
1 merge request!532List formatting is not retained when AI response is used, check other formatting as well
......@@ -27,7 +27,7 @@ const replaceSelectedText = (view, responseText, replace = false) => {
);
}
if (responseText.includes('\n\n')) {
if (responseText.includes('\n\n') || /^\d+\..*\n/.test(responseText)) {
responseText.split('\n\n').forEach(element => {
paragraphNodes.push(
parser.parse(elementFromString(element.replace(/\n/g, '<br />')), {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment