Hyperlinks in word(.docx)file are lost when upload to Data Source #13309

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

Originally created by @David1007587693 on GitHub (Apr 24, 2025).

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

v1.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Hyperlinks in word(.docx)f

ile are lost when upload to Data Source

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @David1007587693 on GitHub (Apr 24, 2025). ### 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 v1.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Hyperlinks in word(.docx)f <!-- Failed to upload "image.png" --> ile are lost when upload to Data Source ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:11:34 -05:00
yindo closed this issue 2026-02-21 19:11:34 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 24, 2025):

Hello @David1007587693! I'm Dosu, your friendly bot here to help you with bugs, questions, and becoming a contributor while you wait for a human maintainer. Let's tackle this issue together! 🚀

The issue of hyperlinks being lost when uploading a .docx file to a Data Source in Dify might be related to how the _extract_text_from_docx function processes these files. This function is designed to handle hyperlinks by searching for "HYPERLINK" in the XML of each run within a paragraph and formatting the text with the hyperlink using markdown format [text](url) [1].

If hyperlinks are not being preserved, it could be due to a bug or misconfiguration. Ensure that the process_rule parameter is set correctly in your API request. You might need to set the process_rule to custom mode and disable the remove_urls_emails preprocessing rule by setting its enabled property to false [2].

If the issue persists, it might require further investigation into the specific implementation or configuration of your Dify setup.

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Apr 24, 2025): <!-- Greeting --> Hello @David1007587693! I'm [Dosu](https://dosu.dev), your friendly bot here to help you with bugs, questions, and becoming a contributor while you wait for a human maintainer. Let's tackle this issue together! 🚀 <!-- Answer --> The issue of hyperlinks being lost when uploading a .docx file to a Data Source in Dify might be related to how the `_extract_text_from_docx` function processes these files. This function is designed to handle hyperlinks by searching for "HYPERLINK" in the XML of each run within a paragraph and formatting the text with the hyperlink using markdown format `[text](url)` <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/rag/extractor/word_extractor.py)</sup>. If hyperlinks are not being preserved, it could be due to a bug or misconfiguration. Ensure that the `process_rule` parameter is set correctly in your API request. You might need to set the `process_rule` to `custom` mode and disable the `remove_urls_emails` preprocessing rule by setting its `enabled` property to `false` <sup>[[2]](https://github.com/langgenius/dify/issues/16638)</sup>. If the issue persists, it might require further investigation into the specific implementation or configuration of your Dify setup. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/e6fed8c6-ebe3-4116-9eb9-91ef6f9cfad9?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/e6fed8c6-ebe3-4116-9eb9-91ef6f9cfad9?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/e6fed8c6-ebe3-4116-9eb9-91ef6f9cfad9?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/e6fed8c6-ebe3-4116-9eb9-91ef6f9cfad9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e6fed8c6-ebe3-4116-9eb9-91ef6f9cfad9?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/e6fed8c6-ebe3-4116-9eb9-91ef6f9cfad9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e6fed8c6-ebe3-4116-9eb9-91ef6f9cfad9?feedback_type=other)</sup>
Author
Owner
@crazywoola commented on GitHub (Apr 24, 2025): https://github.com/langgenius/dify/blob/0277a37fcad5ad86aeb239485c27fffd5cd90043/CONTRIBUTING.md#L23-L33 <img width="890" alt="Image" src="https://github.com/user-attachments/assets/548dbd30-b11c-4562-a30f-ffa99f698ac9" />
Author
Owner

@David1007587693 commented on GitHub (May 6, 2025):

dify/CONTRIBUTING.md

Lines 23 to 33 in 0277a37

Bug reports

Important

Please make sure to include the following information when submitting a bug report:

  • A clear and descriptive title
  • A detailed description of the bug, including any error messages
  • Steps to reproduce the bug
  • Expected behavior
  • Logs, if available, for backend issues, this is really important, you can find them in docker-compose logs
  • Screenshots or videos, if applicable
    Image

Thanks, but it didn't work. Can you try write a docx file with hyperlinks and then upload it to check this problem?

@David1007587693 commented on GitHub (May 6, 2025): > [dify/CONTRIBUTING.md](https://github.com/langgenius/dify/blob/0277a37fcad5ad86aeb239485c27fffd5cd90043/CONTRIBUTING.md#L23-L33) > > Lines 23 to 33 in [0277a37](/langgenius/dify/commit/0277a37fcad5ad86aeb239485c27fffd5cd90043) > > ### Bug reports > > > [!IMPORTANT] > > Please make sure to include the following information when submitting a bug report: > > - A clear and descriptive title > - A detailed description of the bug, including any error messages > - Steps to reproduce the bug > - Expected behavior > - **Logs**, if available, for backend issues, this is really important, you can find them in docker-compose logs > - Screenshots or videos, if applicable > <img alt="Image" width="890" src="https://private-user-images.githubusercontent.com/100913391/436960392-548dbd30-b11c-4562-a30f-ffa99f698ac9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY1Mzc3MDcsIm5iZiI6MTc0NjUzNzQwNywicGF0aCI6Ii8xMDA5MTMzOTEvNDM2OTYwMzkyLTU0OGRiZDMwLWIxMWMtNDU2Mi1hMzBmLWZmYTk5ZjY5OGFjOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNTA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDUwNlQxMzE2NDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mNDA3ZmRkMTIwMDRhMTIxY2YwNmU1YWJkN2I4MzAzOGJlNDYzZDllYTNkZWQ0YzgxNjMyZTc5NzljYjA1OTliJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.jLAsQWPRh8DxUVwvPlvlu-IogYpNlm3x8VgsXzmGtQ8"> Thanks, but it didn't work. Can you try write a docx file with hyperlinks and then upload it to check this problem?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13309