Reply button Link (abbr) is broken #11814

Closed
opened 2026-02-21 19:04:11 -05:00 by yindo · 2 comments
Owner

Originally created by @EcoleKeine on GitHub (Mar 19, 2025).

Originally assigned to: @crazywoola on GitHub.

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.1.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

make llm output:

[next advice](abbr:next%20advice)
[advice](abbr:advice)

✔️ Expected Behavior

create buttons that user can click to send message

Actual Behavior

should create buttons, but now is a link in 1.1.0

working in 0.15.3

Originally created by @EcoleKeine on GitHub (Mar 19, 2025). Originally assigned to: @crazywoola on GitHub. ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.1.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce make llm output: ``` [next advice](abbr:next%20advice) [advice](abbr:advice) ``` ### ✔️ Expected Behavior create buttons that user can click to send message ### ❌ Actual Behavior should create buttons, but now is a link in 1.1.0 working in 0.15.3
yindo added the 🐞 bugstale labels 2026-02-21 19:04:11 -05:00
yindo closed this issue 2026-02-21 19:04:11 -05:00
Author
Owner

@ouweican commented on GitHub (Mar 31, 2025):

temporary solution
path: dify/web/app/components/base/markdown.tsx

add demo

export function urlTransform(value: string) {
  const safeProtocol = /^(https?|ircs?|mailto|xmpp|abbr)$/i
  const colon = value.indexOf(':')
  const questionMark = value.indexOf('?')
  const numberSign = value.indexOf('#')
  const slash = value.indexOf('/')

  if (
    // If there is no protocol, it’s relative.
    // colon === -1
    // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
    (slash !== -1 && colon > slash)
    || (questionMark !== -1 && colon > questionMark)
    || (numberSign !== -1 && colon > numberSign)
    // It is a protocol, it should be allowed.
    || safeProtocol.test(value.slice(0, colon))
  )
    return value

  return ''
}
<ReactMarkdown
  ...props
  urlTransform={urlTransform}>
  {latexContent}
</ReactMarkdown>
@ouweican commented on GitHub (Mar 31, 2025): temporary solution path: dify/web/app/components/base/markdown.tsx add demo ```typescript export function urlTransform(value: string) { const safeProtocol = /^(https?|ircs?|mailto|xmpp|abbr)$/i const colon = value.indexOf(':') const questionMark = value.indexOf('?') const numberSign = value.indexOf('#') const slash = value.indexOf('/') if ( // If there is no protocol, it’s relative. // colon === -1 // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol. (slash !== -1 && colon > slash) || (questionMark !== -1 && colon > questionMark) || (numberSign !== -1 && colon > numberSign) // It is a protocol, it should be allowed. || safeProtocol.test(value.slice(0, colon)) ) return value return '' } ``` ```typescript <ReactMarkdown ...props urlTransform={urlTransform}> {latexContent} </ReactMarkdown>
Author
Owner

@dosubot[bot] commented on GitHub (May 1, 2025):

Hi, @EcoleKeine. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • Reported bug in Dify version 1.1.0 where buttons generate links instead.
  • Issue occurs in a self-hosted Docker environment.
  • Temporary solution provided by user ouweican involves modifying markdown.tsx with a urlTransform function.

Next Steps:

  • Please confirm if this issue is still relevant to the latest version of Dify. If so, you can keep the discussion open by commenting here.
  • If no further activity occurs, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (May 1, 2025): Hi, @EcoleKeine. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - Reported bug in Dify version 1.1.0 where buttons generate links instead. - Issue occurs in a self-hosted Docker environment. - Temporary solution provided by user ouweican involves modifying `markdown.tsx` with a `urlTransform` function. **Next Steps:** - Please confirm if this issue is still relevant to the latest version of Dify. If so, you can keep the discussion open by commenting here. - If no further activity occurs, this issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#11814