-
-
Notifications
You must be signed in to change notification settings - Fork 80
Strip <p> tags from sponsorLabel in CallToActionNode renderer
#1476
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
Conversation
ref https://linear.app/ghost/issue/PLG-370/fix-sponsor-label-rendering-on-web - Added logic to remove SponsorLabel <p> paragraph tags to avoid bad rendering on certain situations.
WalkthroughThe pull request updates the call-to-action node’s rendering logic by incorporating HTML cleaning for the sponsor label. A new import statement brings in the Possibly related PRs
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
packages/kg-default-nodes/lib/utils/build-clean-basic-html-for-element.jsOops! Something went wrong! :( ESLint: 8.57.0 Error: Failed to load parser '@babel/eslint-parser' declared in 'packages/kg-default-nodes/.eslintrc.js': Cannot find module '@babel/eslint-parser'
packages/kg-default-nodes/lib/nodes/call-to-action/calltoaction-renderer.jsOops! Something went wrong! :( ESLint: 8.57.0 Error: Failed to load parser '@babel/eslint-parser' declared in 'packages/kg-default-nodes/.eslintrc.js': Cannot find module '@babel/eslint-parser'
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🔇 Additional comments (6)
✨ 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:
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 (
|
<p> tags from sponsorLabel in CallToActionNode renderer
This reverts commit 14981e0.
ref https://linear.app/ghost/issue/PLG-370/fix-sponsor-label-rendering-on-web - Added logic to remove SponsorLabel <p> paragraph tags to avoid bad rendering on certain situations.
ref https://linear.app/ghost/issue/PLG-370/fix-sponsor-label-rendering-on-web
renderCallToActionNodeincalltoaction-renderer.jsto cleandataset.sponsorLabelusingbuildCleanBasicHtmlForElementwithfirstChildInnerContent: true, ensuring<p>tags are removed before rendering.buildCleanBasicHtmlForElement.jsto acceptadditionalOptions, merging them with the defaultcreateDocumentoption to supportfirstChildInnerContentand maintain flexibility.call-to-action.test.jsto verify.kg-cta-sponsor-labelhas<span>as its first child without<p>tags, ensuring correct rendering behavior.Fixes sponsor label rendering issue where
<p>tags persisted in output.