mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-06-28 06:46:12 +00:00
Fix/issue 17604 (#17627)
* 🎨 https://github.com/siyuan-note/siyuan/issues/17604 * Potential fix for pull request finding 更加严格的校验 Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: get nearest li from precise block * fix: 修正range逻辑 * fix: 撤销对原逻辑的改动 * fix: 代码更正 --------- Co-authored-by: JavenLu233 <javenlu233@163.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -3211,9 +3211,18 @@ export class WYSIWYG {
|
||||
if (embedElement) {
|
||||
blockElement = embedElement;
|
||||
}
|
||||
newRange = focusBlock(blockElement, undefined, event.clientX < rect.left + parseInt(this.element.style.paddingLeft)) || newRange;
|
||||
if (protyle.options.render.breadcrumb) {
|
||||
protyle.breadcrumb.render(protyle, false, blockElement);
|
||||
|
||||
// 如果是列表块(list/li),不修正 range https://github.com/siyuan-note/siyuan/issues/17604
|
||||
if (blockElement.classList.contains("list") || blockElement.classList.contains("li")) {
|
||||
if (protyle.options.render.breadcrumb) {
|
||||
const breadcrumbElement = hasClosestBlock(newRange.startContainer);
|
||||
protyle.breadcrumb.render(protyle, false, breadcrumbElement);
|
||||
}
|
||||
} else {
|
||||
newRange = focusBlock(blockElement, undefined, event.clientX < rect.left + parseInt(this.element.style.paddingLeft)) || newRange;
|
||||
if (protyle.options.render.breadcrumb) {
|
||||
protyle.breadcrumb.render(protyle, false, blockElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user