-
-
Notifications
You must be signed in to change notification settings - Fork 1
Fix inlines #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix inlines #38
Conversation
WalkthroughThe changes introduce improved preprocessing and rendering for Djot markdown extensions, including robust handling of ordered lists, tables, blockquotes, and task lists. New test cases and snapshot files are added to verify the output. The out-of-the-box index content is centralized as a shared constant, and configuration now references this constant for initialization. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DjotParser
participant Preprocessor
participant Renderer
User->>DjotParser: Submit markdown input
DjotParser->>Preprocessor: Preprocess input (tables, ordered lists, tasks)
Preprocessor->>Preprocessor: Detect and convert tables
Preprocessor->>Preprocessor: Detect and convert ordered lists
Preprocessor->>Preprocessor: Detect and convert task lists
Preprocessor->>DjotParser: Return preprocessed markdown
DjotParser->>Renderer: Parse and convert to HTML
Renderer->>User: Output rendered HTML
Possibly related PRs
Poem
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. 🪧 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 (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
cynthia_websites_mini_client/src/cynthia_websites_mini_client/pottery/djotparse.gleam (1)
520-642: Significant improvement in table processing robustness.The rewritten table conversion logic is much more robust with:
- Proper separator line detection using character analysis
- Support for multiple header lines
- Nested Djot content in cells via
entry_to_conversionHowever, consider adding validation to ensure all rows have a consistent number of columns to prevent rendering issues with malformed tables.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
cynthia_websites_mini_client/birdie_snapshots/djot_with_preprocessing_test.accepted(1 hunks)cynthia_websites_mini_client/birdie_snapshots/links_in_preprocessed_items_test.accepted(1 hunks)cynthia_websites_mini_client/birdie_snapshots/ootb_index_rendering_test.accepted(1 hunks)cynthia_websites_mini_client/birdie_snapshots/ordered_list_with_links_test.accepted(1 hunks)cynthia_websites_mini_client/src/cynthia_websites_mini_client/pottery/djotparse.gleam(8 hunks)cynthia_websites_mini_client/test/cynthia_websites_mini_client_test.gleam(2 hunks)cynthia_websites_mini_server/src/cynthia_websites_mini_server/config.gleam(1 hunks)cynthia_websites_mini_shared/src/cynthia_websites_mini_shared/configtype.gleam(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: strawmelonjuice
PR: CynthiaWebsiteEngine/Mini#33
File: cynthia_websites_mini_server/src/cynthia_websites_mini_server/config.gleam:896-899
Timestamp: 2025-07-10T13:40:49.876Z
Learning: In CynthiaWebsiteEngine Mini, the user prefers to avoid requiring external dependencies like Pandoc during initial setup to maintain a smooth out-of-the-box experience, even if it means accepting some compatibility risks with Markdown/Djot parsing differences.
cynthia_websites_mini_server/src/cynthia_websites_mini_server/config.gleam (1)
Learnt from: strawmelonjuice
PR: CynthiaWebsiteEngine/Mini#33
File: cynthia_websites_mini_server/src/cynthia_websites_mini_server/config.gleam:896-899
Timestamp: 2025-07-10T13:40:49.876Z
Learning: In CynthiaWebsiteEngine Mini, the user prefers to avoid requiring external dependencies like Pandoc during initial setup to maintain a smooth out-of-the-box experience, even if it means accepting some compatibility risks with Markdown/Djot parsing differences.
cynthia_websites_mini_client/birdie_snapshots/djot_with_preprocessing_test.accepted (1)
Learnt from: strawmelonjuice
PR: CynthiaWebsiteEngine/Mini#33
File: cynthia_websites_mini_server/src/cynthia_websites_mini_server/config.gleam:896-899
Timestamp: 2025-07-10T13:40:49.876Z
Learning: In CynthiaWebsiteEngine Mini, the user prefers to avoid requiring external dependencies like Pandoc during initial setup to maintain a smooth out-of-the-box experience, even if it means accepting some compatibility risks with Markdown/Djot parsing differences.
cynthia_websites_mini_client/test/cynthia_websites_mini_client_test.gleam (1)
Learnt from: strawmelonjuice
PR: CynthiaWebsiteEngine/Mini#33
File: cynthia_websites_mini_server/src/cynthia_websites_mini_server/config.gleam:896-899
Timestamp: 2025-07-10T13:40:49.876Z
Learning: In CynthiaWebsiteEngine Mini, the user prefers to avoid requiring external dependencies like Pandoc during initial setup to maintain a smooth out-of-the-box experience, even if it means accepting some compatibility risks with Markdown/Djot parsing differences.
🔇 Additional comments (11)
cynthia_websites_mini_shared/src/cynthia_websites_mini_shared/configtype.gleam (1)
160-209: Well-structured out-of-the-box content constant.The
ootb_indexconstant provides comprehensive test coverage for Djot markdown features including headings with IDs, lists, images, blockquotes, task lists, code blocks, and tables. This centralizes the default content and improves maintainability.cynthia_websites_mini_client/birdie_snapshots/djot_with_preprocessing_test.accepted (1)
14-16: Improved HTML structure for task items and blockquotes.The changes standardize content wrapping by using
<span><p>elements for task items and<p>elements for blockquotes instead of raw text or<pre>tags. This provides more consistent styling and better semantic markup.cynthia_websites_mini_client/birdie_snapshots/ordered_list_with_links_test.accepted (1)
1-9: Comprehensive test coverage for ordered lists with inline formatting.The snapshot correctly validates ordered list rendering with embedded links and bold text formatting. The HTML structure uses semantic elements and proper CSS classes for styling.
cynthia_websites_mini_server/src/cynthia_websites_mini_server/config.gleam (1)
919-919: Good refactoring to use centralized constant.Replacing the inline content with
configtype.ootb_indeximproves maintainability and ensures consistency between the default configuration and test cases.cynthia_websites_mini_client/birdie_snapshots/links_in_preprocessed_items_test.accepted (1)
1-11: Targeted test coverage for links in preprocessed content.The snapshot validates proper link rendering within task items and blockquotes, ensuring that the preprocessing pipeline correctly handles inline links while maintaining semantic HTML structure and consistent styling.
cynthia_websites_mini_client/birdie_snapshots/ootb_index_rendering_test.accepted (1)
1-63: LGTM! Well-structured test snapshot.The snapshot properly captures the expected HTML output with appropriate styling classes, accessibility attributes, and semantic markup. The structure aligns well with the Djot preprocessing improvements mentioned in the PR.
cynthia_websites_mini_client/test/cynthia_websites_mini_client_test.gleam (1)
3-3: Good test coverage for the Djot preprocessing improvements.The new tests appropriately cover the key scenarios:
- Links within preprocessed elements (task lists, blockquotes)
- Ordered lists with embedded formatting
- Rendering of the centralized
ootb_indexcontentTests follow the established patterns and will help catch regressions.
Also applies to: 63-85
cynthia_websites_mini_client/src/cynthia_websites_mini_client/pottery/djotparse.gleam (4)
40-45: Good reordering of preprocessing pipeline.Moving table preprocessing before autolinks prevents autolinks from interfering with table structure. The addition of ordered list preprocessing as a separate step improves separation of concerns.
89-105: Clean simplification of paragraph handling.Removing the ordered list detection logic from here is appropriate since ordered lists are now handled in the preprocessing phase. This improves code clarity and maintainability.
728-728: Excellent improvement for nested content support.Using
entry_to_conversionfor blockquote and task list content enables proper rendering of nested Djot elements (links, formatting, etc.) instead of just raw text. This significantly improves the flexibility and correctness of the rendering.Also applies to: 753-753, 773-773
816-885: Well-implemented ordered list preprocessing.The new dedicated preprocessing for ordered lists is a clean improvement:
- Clear pattern matching for numbered items
- Proper handling of contiguous list blocks
- Support for nested Djot content in list items
- Better separation of concerns from paragraph processing
Summary by CodeRabbit
New Features
Bug Fixes
Tests