Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/red-donuts-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'cherry-markdown': patch
---

fix: #1622 表格左右滚动影响到图表的问题
2 changes: 1 addition & 1 deletion packages/cherry-markdown/src/Previewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ export default class Previewer {
// 处理表格包含图表的特殊场景
let hasUpdate = false;
if (
newContent[change.newIndex].dom.className === 'cherry-table-container' &&
newContent[change.newIndex].dom.className === 'cherry-table-wrapper' &&
newContent[change.newIndex].dom.querySelector('.cherry-table-figure') &&
oldContent[change.oldIndex].dom.querySelector('.cherry-table-figure')
) {
Expand Down
4 changes: 2 additions & 2 deletions packages/cherry-markdown/src/core/hooks/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ export default class Table extends ParagraphBase {
})
.replace(/\\\|/g, '|'); // escape \|
return {
html: `<div class="cherry-table-container" data-sign="${sign}${dataLines}" data-lines="${dataLines}">
<table class="cherry-table">${renderHtml}</table></div>`,
html: `<div class="cherry-table-wrapper" data-sign="${sign}${dataLines}" data-lines="${dataLines}">
<div class="cherry-table-container"><table class="cherry-table">${renderHtml}</table></div></div>`,
sign,
};
}
Expand Down
Loading