Skip to content

feat: distinguish between underline and strikethrough labels#460

Open
wuyiping0628 wants to merge 1 commit intodevfrom
wyp/ol-0319
Open

feat: distinguish between underline and strikethrough labels#460
wuyiping0628 wants to merge 1 commit intodevfrom
wyp/ol-0319

Conversation

@wuyiping0628
Copy link
Collaborator

@wuyiping0628 wuyiping0628 commented Mar 19, 2026

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Bug Fixes
    • Updated strikethrough formatting implementation to use the correct HTML element for proper semantic representation of text styling.

@github-actions github-actions bot added the enhancement New feature or request label Mar 19, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

Walkthrough

The strikethrough formatting implementation is updated from using the u (underline) HTML element to the semantically correct s (strikethrough) element across the fluent-editor packages. Changes are applied to the format definition, stylesheet selector, and example content.

Changes

Cohort / File(s) Summary
Strike Format Implementation
packages/fluent-editor/src/formats/strike.ts, packages/fluent-editor/src/assets/editor.scss
Updated StrikeBlot.tagName from u to s and changed the corresponding SCSS selector from u.ql-custom-strike to s.ql-custom-strike for consistent strikethrough rendering.
Example Content
packages/projects/src/views/yuque/YuQue.vue
Updated DEFAULT_CONTENT HTML example to use <s> tag instead of <u class="ql-custom-strike"> for strikethrough representation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Strikethrough tales once told in u,
Now rest in s where they're due,
A semantic hop, both clean and bright,
HTML elements shining right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating the strikethrough implementation to use semantic HTML tags instead of tags, which distinguishes strikethrough from underline formatting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wyp/ol-0319
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/fluent-editor/src/assets/editor.scss`:
- Around line 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.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c2f3eb1a-9d1d-4f12-9ce1-f93f1db17374

📥 Commits

Reviewing files that changed from the base of the PR and between 270a8cd and 3aab6df.

📒 Files selected for processing (3)
  • packages/fluent-editor/src/assets/editor.scss
  • packages/fluent-editor/src/formats/strike.ts
  • packages/projects/src/views/yuque/YuQue.vue

Comment on lines +71 to 73
s.ql-custom-strike {
text-decoration: line-through;
}
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant