Skip to content

Fix for html link issue #932#955

Merged
matKlju merged 3 commits intobuerokratt:devfrom
rootcodelabs:fix/html_link_issue
Apr 9, 2026
Merged

Fix for html link issue #932#955
matKlju merged 3 commits intobuerokratt:devfrom
rootcodelabs:fix/html_link_issue

Conversation

@ruwinirathnamalala
Copy link
Copy Markdown
Collaborator

@ruwinirathnamalala ruwinirathnamalala commented Apr 6, 2026

#932

Linked PR in chatbot : buerokratt/Buerokratt-Chatbot#1843

This pull request focuses on improving the safety and consistency of link handling across the application by ensuring that all URLs are absolute (i.e., include a protocol such as https://). The changes introduce a new utility function, ensureAbsoluteUrl, and apply it throughout the codebase to normalize links in user-generated content, markdown rendering, and the rich text editor. This helps prevent issues with malformed or potentially unsafe URLs.

Link normalization and safety improvements:

  • Added a new utility function ensureAbsoluteUrl to utils/string-util.ts, which ensures that a given URL is absolute by prepending https:// if necessary.
  • Updated FormRichText component to normalize all anchor (<a>) tag href attributes to absolute URLs both on mount and on every content change, and also during the onChange handler. [1] [2] [3]
  • Modified the StepNode component to use ensureAbsoluteUrl when rendering links, ensuring that all links in step descriptions are absolute and safe. [1] [2]
  • Enhanced the Markdowify component to use ensureAbsoluteUrl for all rendered links, both in the main markdown rendering and in the HTML-to-markdown conversion utility. [1] [2] [3]

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 6, 2026

@matKlju matKlju linked an issue Apr 6, 2026 that may be closed by this pull request
4 tasks
@matKlju matKlju linked an issue Apr 6, 2026 that may be closed by this pull request
4 tasks
Copy link
Copy Markdown
Collaborator

@matKlju matKlju left a comment

Choose a reason for hiding this comment

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

LGTM

@matKlju matKlju removed the request for review from Thirunayan22 April 8, 2026 13:11
@matKlju matKlju merged commit 7fa937b into buerokratt:dev Apr 9, 2026
8 checks passed
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] Broken Links & HTML Artifacts in Message to Client

3 participants