mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-19 14:56:09 +01:00
This commit is contained in:
parent
306fab4fee
commit
dda4634126
2 changed files with 23 additions and 7 deletions
|
|
@ -59,7 +59,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
|
|||
const firstColIndex = cellElements[0].getAttribute("data-col-id");
|
||||
values.find(rowItem => {
|
||||
if (!currentRowElement) {
|
||||
currentRowElement = cellElements[0].parentElement;
|
||||
currentRowElement = hasClosestByClassName(cellElements[0].parentElement, "av__row") as HTMLElement;
|
||||
} else {
|
||||
currentRowElement = currentRowElement.nextElementSibling;
|
||||
}
|
||||
|
|
@ -71,7 +71,11 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
|
|||
if (!cellElement) {
|
||||
cellElement = currentRowElement.querySelector(`.av__cell[data-col-id="${firstColIndex}"]`) as HTMLElement;
|
||||
} else {
|
||||
cellElement = cellElement.nextElementSibling as HTMLElement;
|
||||
if (cellElement.nextElementSibling) {
|
||||
cellElement = cellElement.nextElementSibling as HTMLElement;
|
||||
} else if (cellElement.parentElement.classList.contains("av__colsticky")) {
|
||||
cellElement = cellElement.parentElement.nextElementSibling as HTMLElement;
|
||||
}
|
||||
}
|
||||
if (!cellElement.classList.contains("av__cell")) {
|
||||
return true;
|
||||
|
|
@ -156,7 +160,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
|
|||
const firstColIndex = cellElements[0].getAttribute("data-col-id");
|
||||
textJSON.forEach((rowValue) => {
|
||||
if (!currentRowElement) {
|
||||
currentRowElement = cellElements[0].parentElement;
|
||||
currentRowElement = hasClosestByClassName(cellElements[0].parentElement, "av__row") as HTMLElement;
|
||||
} else {
|
||||
currentRowElement = currentRowElement.nextElementSibling;
|
||||
}
|
||||
|
|
@ -168,7 +172,11 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
|
|||
if (!cellElement) {
|
||||
cellElement = currentRowElement.querySelector(`.av__cell[data-col-id="${firstColIndex}"]`) as HTMLElement;
|
||||
} else {
|
||||
cellElement = cellElement.nextElementSibling as HTMLElement;
|
||||
if (cellElement.nextElementSibling) {
|
||||
cellElement = cellElement.nextElementSibling as HTMLElement;
|
||||
} else if (cellElement.parentElement.classList.contains("av__colsticky")) {
|
||||
cellElement = cellElement.parentElement.nextElementSibling as HTMLElement;
|
||||
}
|
||||
}
|
||||
if (!cellElement.classList.contains("av__cell")) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue