Rich Text: don't remove ordered lists#14386
Conversation
Summary of ChangesHello @swissspidy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where ordered list numbering was being incorrectly removed in the rich text editor's display preview. By adjusting the configuration of Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Plugin builds for a1d8f36 are ready 🛎️!
|
|
Size Change: +12 B (0%) Total Size: 2.99 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request prevents draftjs-filters from stripping numbered list patterns by adding blockTextRules: [] to the filter configuration. This is a good fix for the described issue. I have one minor suggestion to add a comment explaining why this empty array is necessary, which will improve code maintainability for future developers.
| entities: [], | ||
| maxNesting: 1, | ||
| whitespacedCharacters: [], | ||
| blockTextRules: [], |
There was a problem hiding this comment.
While this change correctly fixes the issue, adding a brief comment explaining why blockTextRules is being set to an empty array would improve code clarity and maintainability. It's not immediately obvious that this is to prevent draftjs-filters from stripping list markers by default.
// By default, draftjs-filters strips list markers. An empty array prevents this.
blockTextRules: [],
Summary
Prevent text starting with numbered list patterns (e.g., "1. hello", "2. world") from being stripped in DisplayText preview mode, showing only "hello" and "world".
This PR prevents this default behavior caused by
draftjs-filtersUser-facing changes
Testing Instructions
This PR can be tested by following these steps:
Write something like
and then exit edit mode.
The numbers should still be visible.
Reviews
Does this PR have a security-related impact?
Does this PR change what data or activity we track or use?
Does this PR have a legal-related impact?
Checklist
Type: XYZlabel to the PRFixes #14092