Skip to content

Commit 33feb4b

Browse files
authored
fix(CodePreview): 优化双栏布局内容生成逻辑 (DevCloudFE#1741)
1 parent f260f6d commit 33feb4b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/devui-vue/devui/code-review/src/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ export function parseDiffCode(container: HTMLElement, code: string, outputFormat
169169
newTrStr += `<tr>${leftTdList?.join('')}${rightTdList?.join('')}</tr>`;
170170
}
171171
const tbodyAttr = diffHtmlStr.match(TableTbodyAttrReg)?.[1] || '';
172-
const newDiffHtmlStr = diffHtmlStr.replace(TableTbodyReg, `<tbody ${tbodyAttr}>${newTrStr}</tbody>`);
172+
const emptyDiffHtmlStr = diffHtmlStr.replace(TableTbodyReg, `<tbody${tbodyAttr}></tbody>`);
173+
const index = emptyDiffHtmlStr.indexOf(`<tbody${tbodyAttr}>`);
174+
const newDiffHtmlStr = emptyDiffHtmlStr.slice(0, index) + newTrStr + emptyDiffHtmlStr.slice(index);
173175
diff2HtmlUi.diffHtml = newDiffHtmlStr;
174176
}
175177
diff2HtmlUi.draw();

packages/devui-vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-devui",
3-
"version": "1.5.15-feat.1",
3+
"version": "1.5.15-hotfix.1",
44
"license": "MIT",
55
"description": "DevUI components based on Vite and Vue3",
66
"keywords": [

0 commit comments

Comments
 (0)