Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/fluent-editor/src/assets/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
text-decoration: line-through;
}

u.ql-custom-strike {
s.ql-custom-strike {
text-decoration: line-through;
}
Comment on lines +71 to 73
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Preserve legacy strike rendering for existing u.ql-custom-strike content.

Line 71 removes the old selector path; older stored HTML using u.ql-custom-strike will now render as underline (because of the u rule below), not strike.

💡 Suggested compatibility-safe fix
-    s.ql-custom-strike {
+    s.ql-custom-strike,
+    u.ql-custom-strike {
       text-decoration: line-through;
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
s.ql-custom-strike {
text-decoration: line-through;
}
s.ql-custom-strike,
u.ql-custom-strike {
text-decoration: line-through;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/fluent-editor/src/assets/editor.scss` around lines 71 - 73, Restore
compatibility for legacy HTML by ensuring the .ql-custom-strike rule targets
both the current element and the older 'u' tag: add or change the selector to
include u.ql-custom-strike (e.g., u.ql-custom-strike, s.ql-custom-strike {
text-decoration: line-through; }) so existing content using u.ql-custom-strike
continues to render as strikethrough while keeping the s.ql-custom-strike rule.


Expand Down
2 changes: 1 addition & 1 deletion packages/fluent-editor/src/formats/strike.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Inline = Quill.import('blots/inline') as typeof TypeInline

export class StrikeBlot extends Inline {
static blotName = 'strike'
static tagName = 'u'
static tagName = 's'
static className = 'ql-custom-strike'
// 此处删除了formats方法,当前tag非span,则并不需要进行特殊处理去重写formats方法
}
2 changes: 1 addition & 1 deletion packages/projects/src/views/yuque/YuQue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const DEFAULT_CONTENT = `
</p>
<p>这是<strong>粗体</strong></p>
<p>这是<em>斜体</em></p>
<p>这是<u class="ql-custom-strike">删除线</u></p>
<p>这是<s class="ql-custom-strike">删除线</s></p>
<p>这是<u>下划线</u></p>
<p>这是上标X<sup>2</sup>和下标X<sub>2</sub></p>
<p>
Expand Down
Loading