Conversation
WalkthroughThe changes introduce a new helper module for parsing additional assets in HTML content and generalize existing asset extraction and replacement logic to support asset types beyond images. Functions are renamed and refactored to handle a broader range of assets, integrating new helper functions for extensibility. Changes
Poem
✨ Finishing Touches
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/editor/src/ce/helpers/parser.ts (2)
6-6: Add TODO comments for stub implementation clarity.The function currently returns an empty array, which appears to be intentional for future expansion. Consider adding a TODO comment to clarify the planned implementation.
-export const extractAdditionalAssetsFromHTMLContent = (_htmlContent: string): string[] => []; +export const extractAdditionalAssetsFromHTMLContent = (_htmlContent: string): string[] => { + // TODO: Implement extraction of additional asset types beyond images + return []; +};
13-19: Utilize the assetMap parameter or document the stub implementation.The function extracts
htmlContentfrom props but ignores theassetMapparameter, returning the original content unchanged. This suggests incomplete implementation.export const replaceAdditionalAssetsInHTMLContent = (props: { htmlContent: string; assetMap: Record<string, string>; }): string => { - const { htmlContent } = props; + const { htmlContent, assetMap } = props; + // TODO: Implement replacement of additional asset types using assetMap return htmlContent; };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/editor/src/ce/helpers/parser.ts(1 hunks)packages/editor/src/core/helpers/parser.ts(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
packages/editor/src/core/helpers/parser.ts (4)
17-32: LGTM! Well-structured refactoring with proper integration.The function has been successfully generalized from image-specific to multi-asset handling. The integration of
extractAdditionalAssetsFromHTMLContentis clean and maintains the existing functionality while extending capabilities.
39-59: LGTM! Proper integration of additional asset replacement.The refactored function correctly processes image components first, then delegates additional asset replacement to the helper function. The use of
doc.body.innerHTMLas input to the helper function is appropriate.
61-95: LGTM! Consistent function renaming and maintained functionality.The function has been properly renamed from
getEditorContentWithReplacedImageAssetstogetEditorContentWithReplacedAssets, and all internal function calls have been updated to use the new generalized functions. The workflow remains intact while supporting expanded asset types.
4-8: Verify the import path for the new helper functions.The import path
@/plane-editor/helpers/parsershould be verified to ensure it correctly resolves topackages/editor/src/ce/helpers/parser.ts. The path structure suggests it might be incorrect.#!/bin/bash # Verify the import path resolution echo "Checking if the import path resolves correctly..." fd -t f "parser.ts" --exec echo "Found: {}"
|
Pull Request Linked with Plane Work Items Comment Automatically Generated by Plane |
1 similar comment
|
Pull Request Linked with Plane Work Items Comment Automatically Generated by Plane |
Description
This PR adds support for additional parsing of editor content.
Type of Change
Summary by CodeRabbit
New Features
Refactor
Bug Fixes