Fix unused textwrap code and wrap logic#64
Conversation
Reviewer's GuideThis PR removes an unused text wrapping dependency, tightens the markdown tokenizer’s handling of unmatched code delimiters, and refines line-wrapping logic to prevent leading spaces and correctly reset state after a break. Class diagram for updated markdown tokenization and wrapping logicclassDiagram
class MarkdownProcessor {
+reflow_table(lines: &[String]) Vec<String>
+is_fence(line: &str) bool
-tokenize_markdown(text: &str) Vec<String>
-wrap_preserving_code(text: &str, width: usize) Vec<String>
}
%% Removed: protect_code_span_spaces, wrap_segment
%% Removed dependency: textwrap
MarkdownProcessor --|> Regex
MarkdownProcessor : -FENCE_RE
MarkdownProcessor : -BULLET_RE
%% CODE_SPAN_RE removed
Class diagram for removed textwrap dependencyclassDiagram
class textwrap {
<<dependency>>
}
class MarkdownProcessor
MarkdownProcessor ..x textwrap : dependency removed
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
9dd4eca
into
codex/add-tests-for-list-number-formatting-and-wrapping
* Wrap inline code without splitting * Handle multi-backtick inline code * Specify unicode-width version range * Remove unused textwrap logic and fix wrapping (#64)
Summary
Testing
cargo clippy -- -D warningsRUSTFLAGS="-D warnings" cargo testmarkdownlint docs/*.mdhttps://chatgpt.com/codex/tasks/task_e_68753f3d78d48322aebfb11989b70c58
Summary by Sourcery
Remove unused textwrap crate and related functions, improve markdown tokenization for unmatched backticks, and refine line wrapping logic to prevent leading spaces
Bug Fixes:
Enhancements:
Chores: