Commit d11c0554 by pangchong

revert: 撤销在 prepareCleanedHtml 中对 EFFECT 节点的清理逻辑

parent 0a57dc1b
<template>
<!-- 触发按钮 -->
<slot name="trigger" :open="() => appStore.settingsOpen = true">
<slot name="trigger" :open="() => (appStore.settingsOpen = true)">
<CommonButton quaternary circle @click="appStore.settingsOpen = true">
<template #icon>
<n-icon><settings-outline /></n-icon>
......
......@@ -56,7 +56,6 @@ export function useDocNodeRenderer(props: { node: XmlNode; parent?: XmlNode | nu
provide('insideChinese', true)
}
const renderInline = computed(() => {
return props.isInline || INLINE_ELEMENTS_SET.has(props.node.tagName)
})
......@@ -100,7 +99,7 @@ export function useDocNodeRenderer(props: { node: XmlNode; parent?: XmlNode | nu
if (!eff) return 'ALL'
const cleaned = eff.replace(/\s+/g, '')
if (cleaned === '001999') return 'ALL'
// 如果是纯数字,且长度是6的倍数
if (/^\d+$/.test(cleaned) && cleaned.length % 6 === 0) {
const parts: string[] = []
......@@ -130,7 +129,7 @@ export function useDocNodeRenderer(props: { node: XmlNode; parent?: XmlNode | nu
if (cleaned.length === 6) {
return `${cleaned.substring(0, 3)}-${cleaned.substring(3)}`
}
return cleaned
}
......
......@@ -100,10 +100,7 @@
<component
:is="renderInline ? 'span' : 'div'"
class="text-sm leading-relaxed py-1 flex flex-wrap items-center"
:class="[
isInsideAlert ? 'text-inherit' : 'text-color2',
renderInline ? 'inline mx-0.5' : 'flex'
]"
:class="[isInsideAlert ? 'text-inherit' : 'text-color2', renderInline ? 'inline mx-0.5' : 'flex']"
:style="{ justifyContent: 'var(--cell-align, flex-start)' }"
>
<template v-if="node.mixedContent && node.mixedContent.length > 0">
......@@ -680,13 +677,7 @@
<div class="my-1 py-1">
<div class="flex flex-wrap items-center gap-1.5 text-sm text-color2">
<template v-if="node.children && node.children.length > 0">
<DocNodeRenderer
v-for="child in node.children"
:key="child.id"
:node="child"
:parent="node"
is-inline
/>
<DocNodeRenderer v-for="child in node.children" :key="child.id" :node="child" :parent="node" is-inline />
</template>
<template v-else-if="node.textContent && node.textContent.trim()">
<span
......@@ -707,7 +698,11 @@
contenteditable="true"
class="inline-block border-b border-color3 hover:border-primary focus:border-primary min-w-[80px] text-center focus:outline-none focus:bg-fill-2 px-1 mx-1 text-sm font-mono text-primary font-bold transition-all"
:style="{
width: node.attributes.WIDTH ? (node.attributes.WIDTH.includes('px') || node.attributes.WIDTH.includes('%') ? node.attributes.WIDTH : `${node.attributes.WIDTH}px`) : 'auto',
width: node.attributes.WIDTH
? node.attributes.WIDTH.includes('px') || node.attributes.WIDTH.includes('%')
? node.attributes.WIDTH
: `${node.attributes.WIDTH}px`
: 'auto',
minWidth: node.attributes.WIDTH ? '0' : '80px'
}"
@blur="handleTextBlur"
......@@ -1076,7 +1071,7 @@ const {
background-color: var(--n-color-hover);
}
.inline-ref-block > *:not(:first-child)::before {
content: ", ";
content: ', ';
color: inherit;
}
</style>
......@@ -119,12 +119,7 @@ export function useEditor() {
el.remove()
})
// 0.5. 移除所有评估为 'ALL' 且非必填显示的 applicability 标签 (避免在导出的 HTML 中重复出现大量的 ** ON A/C: ALL)
clone.querySelectorAll('[data-tag-name="EFFECT"], [data-tag-name="CONEFFECT"]').forEach((el) => {
if (el.textContent?.includes('ALL')) {
el.remove()
}
})
// 1. 去除 contenteditable 属性,防止打印时显示光标或被编辑
clone.querySelectorAll('[contenteditable]').forEach((el) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment