Skip to content

Conversation

@NarayanBavisetti
Copy link
Collaborator

@NarayanBavisetti NarayanBavisetti commented Sep 8, 2025

Description

this pull request adds two new attributes in the ol tag.

Type of Change

  • Improvement (change that would cause existing functionality to not work as expected)

Summary by CodeRabbit

  • Bug Fixes
    • Improved HTML sanitization to preserve “start” and “type” attributes on supported elements, ensuring list numbering and styles render correctly instead of being stripped.
    • Enhances compatibility with pasted or imported content that relies on these attributes, reducing unexpected formatting changes during display.

Copilot AI review requested due to automatic review settings September 8, 2025 11:35
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 8, 2025

Walkthrough

Expanded the HTML sanitizer’s wildcard attribute set in apps/api/plane/utils/content_validator.py by adding “start” and “type” to ATTRIBUTES["*"]. No other logic, signatures, or control flow were changed.

Changes

Cohort / File(s) Summary of changes
HTML sanitizer attributes
apps/api/plane/utils/content_validator.py
Added "start" and "type" to ATTRIBUTES["*"], broadening allowed attributes during sanitization. No other code paths modified.

Sequence Diagram(s)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

requires approval

Suggested reviewers

  • dheeru0198
  • pablohashescobar
  • sriramveeraghanta

Poem

I twitch my whiskers, hop with pride,
Two tiny attrs join the tide—
start and type now sanitized,
Neat little changes, rabbit-sized.
In HTML fields I safely play,
Nibbling bugs and hops away. 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0cb4976 and bb0ba9a.

📒 Files selected for processing (1)
  • apps/api/plane/utils/content_validator.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/api/plane/utils/content_validator.py (1)

87-89: Scope start and type to <ol> only
Remove from global ATTRIBUTES["*"]:

-    "start",
-    "type",

Add under the "ol" entry in tag-specific ATTRIBUTES:

     "a": {"href","target"},
+    "ol": {"start","type"},

(Optional) allow "type" on <li> if your editor ever emits it.
Confirm that no user-supplied HTML outside <ol> relies on a type attribute.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-ol-tag-validation

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
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for two new HTML attributes (start and type) in the content validation system for the ol (ordered list) tag. This enhancement allows ordered lists to utilize these standard HTML attributes for customizing list numbering behavior.

  • Added start and type attributes to the allowed attributes list in the content validator
  • Enables more flexible ordered list formatting options in the application

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sriramveeraghanta sriramveeraghanta merged commit 291101a into preview Sep 8, 2025
7 of 10 checks passed
@sriramveeraghanta sriramveeraghanta deleted the chore-ol-tag-validation branch September 8, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants