Skip to content

fix: render link tags consistently on canvas#70

Merged
liamwalder merged 3 commits intodevelopfrom
fix/link-tag-on-canvas
Mar 24, 2026
Merged

fix: render link tags consistently on canvas#70
liamwalder merged 3 commits intodevelopfrom
fix/link-tag-on-canvas

Conversation

@tristan-mouchet
Copy link
Copy Markdown
Collaborator

Summary

Fix link <a> tag rendering to behave consistently between the canvas editor and generated pages.

Changes

  • Extract link resolution logic into lib/link-utils.ts utility
  • Simplify LayerRenderer link wrapping to use shared utility
  • Ensure link tags render the same way on canvas and in published output

Test plan

  • Add a link to a layer in the editor and verify the <a> tag renders on the canvas
  • Publish the page and confirm the link renders identically in the generated output
  • Test internal page links, external URLs, and anchor links

- Remove !isEditMode guard from isButtonWithLink and shouldWrapWithLink
- Add w-fit class to edit mode className for buttons rendered as <a>
- Extract shared layerLinkContext to eliminate 3 duplicate constructions
- Merge button-link and <a>-layer-link blocks into single block
- Add resolveLinkAttrs utility to deduplicate href/target/rel/download
@liamwalder liamwalder merged commit 423463a into develop Mar 24, 2026
2 checks passed
@liamwalder liamwalder deleted the fix/link-tag-on-canvas branch March 24, 2026 07:56
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.

bug: link on element should convert element to<a> tag in canvas as well as in published

2 participants