Skip to content
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

There is a problem with clicking on the answer link in markdown format #12954

Open
5 tasks done
zhaohaoyun opened this issue Jan 22, 2025 · 7 comments
Open
5 tasks done

Comments

@zhaohaoyun
Copy link

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

0.15.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Expected Behavior

I checked the prompt log and the markdown link returned is in the correct format, but it does not jump normally when clicked. When I put the mouse over it, the link displayed is: javascript:void(0)

My link format is not the usual http or https, it will call my local DingTalk client and jump to the corresponding page. This format can also jump normally when accessed in a standard MD client (such as Typora). Is there a limit on the link format here? If it does not meet the format, it will become javascript:void(0), which limits many jump functions and possibilities.

This BUG is very important, please do not mark it invalid or simply close it

❌ Actual Behavior

I checked the prompt log and the markdown link returned is in the correct format, but it does not jump normally when clicked. When I put the mouse over it, the link displayed is: javascript:void(0)

Copy link

dosubot bot commented Jan 22, 2025

I found a similar closed issue regarding problems with clicking on markdown links in the Dify application. The suggested solution was to check the Link component in the Dify application, which is responsible for rendering markdown links. It might be helpful to review the implementation of this component or check for any JavaScript errors in the browser's console to gain further insights [1].

In your case, it seems that the issue might be related to the non-standard link format you are using, which calls a local application. The Dify application might have security measures or restrictions that convert such links to javascript:void(0). Unfortunately, I couldn't find specific documentation or configuration options in the Dify codebase that address this behavior. You might want to explore the Link component's code to see if there are any conditions or logic that handle non-standard link formats.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added the 🐞 bug Something isn't working label Jan 22, 2025
@crazywoola
Copy link
Member

crazywoola commented Jan 22, 2025

This is not a bug, currently we do not support deep link because we intend to be a web application, it not a client application.

You can checkout the implementation of our Link componenent.

const Link = ({ node, ...props }: any) => {
if (node.properties?.href && node.properties.href?.toString().startsWith('abbr')) {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { onSend } = useChatContext()
const hidden_text = decodeURIComponent(node.properties.href.toString().split('abbr:')[1])
return <abbr className="underline decoration-dashed !decoration-primary-700 cursor-pointer" onClick={() => onSend?.(hidden_text)} title={node.children[0]?.value}>{node.children[0]?.value}</abbr>
}
else {
return <a {...props} target="_blank" className="underline decoration-dashed !decoration-primary-700 cursor-pointer">{node.children[0] ? node.children[0]?.value : 'Download'}</a>
}
}

@crazywoola crazywoola removed the 🐞 bug Something isn't working label Jan 22, 2025
@zhaohaoyun
Copy link
Author

@crazywoola It doesn't matter whether it's a client or a web application. All I want is to be able to jump normally according to the set link. If you have DingTalk installed on your computer, click the link below.
For example: dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true

@crazywoola
Copy link
Member

@crazywoola It doesn't matter whether it's a client or a web application. All I want is to be able to jump normally according to the set link. If you have DingTalk installed on your computer, click the link below. For example: dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true

Well, it seems not clickable on my phone.

@zhaohaoyun
Copy link
Author

@crazywoola It doesn't matter whether it's a client or a web application. All I want is to be able to jump normally according to the set link. If you have DingTalk installed on your computer, click the link below. For example: dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true@crazywoola无论是客户端还是 Web 应用程序都没有关系。我想要的只是能够按照设定的链接正常跳跃。如果您的计算机上安装了钉钉,请单击下面的链接。例如:dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true

Well, it seems not clickable on my phone.嗯,在我的手机上似乎无法点击。

This is the problem. What I need is to be able to jump to such a link. This link will call up the corresponding client, whether it is a mobile phone or a PC. You can try to access this link with a browser:
dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true
Normal markdown can jump, or link jump

@crazywoola
Copy link
Member

@crazywoola It doesn't matter whether it's a client or a web application. All I want is to be able to jump normally according to the set link. If you have DingTalk installed on your computer, click the link below. For example: dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true@crazywoola无论是客户端还是 Web 应用程序都没有关系。我想要的只是能够按照设定的链接正常跳跃。如果您的计算机上安装了钉钉,请单击下面的链接。例如:dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true

Well, it seems not clickable on my phone.嗯,在我的手机上似乎无法点击。

This is the problem. What I need is to be able to jump to such a link. This link will call up the corresponding client, whether it is a mobile phone or a PC. You can try to access this link with a browser: dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true Normal markdown can jump, or link jump

I opened this issue link on my phone, it won't render as as link component instead it's plain text.

@zhaohaoyun
Copy link
Author

@crazywoola It doesn't matter whether it's a client or a web application. All I want is to be able to jump normally according to the set link. If you have DingTalk installed on your computer, click the link below. For example: dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true@crazywoola无论是客户端还是 Web 应用程序都没有关系。我想要的只是能够按照设定的链接正常跳跃。如果您的计算机上安装了钉钉,请单击下面的链接。例如:dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true@crazywoola无论是客户端还是 Web 应用程序都没有关系。我想要的只是能够按照设定的链接正常跳跃。如果您的计算机上安装了钉钉,请单击下面的链接。例如:dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true@crazywoola无论是客户端还是 Web 应用程序都没有关系。我想要的只是能够按照设定的链接正常跳跃。如果您的计算机上安装了钉钉,请单击下面的链接。例如:dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true

Well, it seems not clickable on my phone.嗯,在我的手机上似乎无法点击。

This is the problem. What I need is to be able to jump to such a link. This link will call up the corresponding client, whether it is a mobile phone or a PC. You can try to access this link with a browser: dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true Normal markdown can jump, or link jump这就是问题所在。我需要的是能够跳转到这样的链接。此链接将调用相应的客户端,无论是手机还是 PC。你可以尝试用浏览器访问这个链接:dingtalk://dingtalkclient/page/link?url=xxxxxxx&pc_slide=true 普通的 markdown 可以跳转,或者链接跳转

I opened this issue link on my phone, it won't render as as link component instead it's plain text.我在手机上打开了这个问题链接,它不会呈现为链接组件,而是纯文本。

All we want is for the links in the markdown format to jump normally regardless of the format. Let's see how to modify the source code ourselves.

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

No branches or pull requests

2 participants