|
|
@@ -881,9 +881,8 @@ function renderBlockHtml(block, shortMap, longMatch, countFn) {
|
|
|
runsHtml += rs ? `<span style="${rs}">${text}</span>` : text
|
|
|
}
|
|
|
|
|
|
- // 长文本高亮:整个 block 内容用边框包裹
|
|
|
+ // 长文本高亮:不在 runs 层面处理,在外层 block 包裹
|
|
|
if (longMatch) {
|
|
|
- runsHtml = `<span class="elem-highlight elem-highlight-long" data-elem-key="${longMatch.elementKey}" data-value-id="${longMatch.valueId || ''}" style="border:1.5px solid ${darkenColor(longMatch.color)};border-radius:3px;padding:2px 4px;cursor:pointer;display:inline;" contenteditable="true" title="${escapeAttr(longMatch.elementName)}">${runsHtml}</span>`
|
|
|
countFn(1)
|
|
|
} else if (shortMap.length > 0 && runsHtml.length > 0) {
|
|
|
// 短文本高亮:用边框包裹
|
|
|
@@ -902,7 +901,15 @@ function renderBlockHtml(block, shortMap, longMatch, countFn) {
|
|
|
}
|
|
|
|
|
|
if (!inner) inner = ' '
|
|
|
- return `<${tag} class="${cls}"${styleAttr} data-block-id="${block.id}">${inner}</${tag}>`
|
|
|
+ let blockHtml = `<${tag} class="${cls}"${styleAttr} data-block-id="${block.id}">${inner}</${tag}>`
|
|
|
+
|
|
|
+ // 长文本高亮:用 div 边框包裹整个段落块(类似表格的包裹方式)
|
|
|
+ if (longMatch) {
|
|
|
+ const borderColor = darkenColor(longMatch.color)
|
|
|
+ blockHtml = `<div class="elem-highlight-wrap" data-elem-key="${longMatch.elementKey}" data-value-id="${longMatch.valueId || ''}" title="${escapeAttr(longMatch.elementName)}" style="border:2px solid ${borderColor};border-radius:4px;padding:6px 8px;margin:4px 0;cursor:pointer;">${blockHtml}</div>`
|
|
|
+ }
|
|
|
+
|
|
|
+ return blockHtml
|
|
|
}
|
|
|
|
|
|
function renderTableHtml(block, longMatch) {
|