Skip to content

Conversation

@allouis
Copy link
Contributor

@allouis allouis commented Jan 6, 2026

ref https://linear.app/ghost/issue/PRO-1548

We were incorrectly storing these attributes as absolute URLs in the DB due to them not being included in the allowlist.


Note

Expands URL transformation coverage to Ghost-specific attributes so editor-stored HTML is normalized correctly.

  • Add data-kg-background-image, data-kg-custom-thumbnail, and data-kg-thumbnail to transformAttributes in html-transform.ts
  • New tests ensure these attributes are converted for absolute→transform-ready, relative→absolute, relative→transform-ready, and end-to-end htmlToTransformReady
  • Verify protocol-relative handling, page-relative paths via itemPath, and ignoring transformations inside <code> blocks for these attributes

Written by Cursor Bugbot for commit a662810. This will update automatically on new commits. Configure here.

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

Warning

Rate limit exceeded

@allouis has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 56 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 395b38c and a662810.

📒 Files selected for processing (5)
  • packages/url-utils/src/utils/html-transform.ts
  • packages/url-utils/test/unit/utils/html-absolute-to-transform-ready.test.js
  • packages/url-utils/test/unit/utils/html-relative-to-absolute.test.js
  • packages/url-utils/test/unit/utils/html-relative-to-transform-ready.test.js
  • packages/url-utils/test/unit/utils/html-to-transform-ready.test.js

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@allouis allouis requested a review from vershwal January 6, 2026 10:02
Copy link
Member

@vershwal vershwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@allouis allouis force-pushed the fix-data-kg-attribute-transformation branch from 016efa7 to 51ac31b Compare January 6, 2026 10:57
@allouis allouis force-pushed the cleanup-early-exit-match branch 2 times, most recently from 8391d6b to 98302cf Compare January 6, 2026 11:04
@allouis allouis force-pushed the fix-data-kg-attribute-transformation branch from 51ac31b to 23c990c Compare January 6, 2026 11:04
Base automatically changed from cleanup-early-exit-match to main January 6, 2026 11:04
ref https://linear.app/ghost/issue/PRO-1548

We were incorrectly storing these attributes as absolute URLs in the DB
due to them not being included in the whitelist.
@allouis allouis force-pushed the fix-data-kg-attribute-transformation branch from 23c990c to a662810 Compare January 6, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants