when need html tag code import in knowledge base,my html tag code blocks are partially deleted.Why? #12509

Closed
opened 2026-02-21 19:07:44 -05:00 by yindo · 6 comments
Owner

Originally created by @ericWenjp on GitHub (Apr 3, 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

1.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When importing front-end code examples into Dify's knowledge base, code blocks are partially deleted. For example, the original content:

vue

<a-input placeholder="input with clear icon" allow-clear @change="onChange"/>  
becomes:

vue

after import.
‘‘<a-input placeholder="input with clear icon" allow-clear @change="onChange"/>’’ all dis。

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @ericWenjp on GitHub (Apr 3, 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 1.0.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When importing front-end code examples into Dify's knowledge base, code blocks are partially deleted. For example, the original content: vue ``` <a-input placeholder="input with clear icon" allow-clear @change="onChange"/> becomes: ``` vue `` `` after import. ‘‘<a-input placeholder="input with clear icon" allow-clear @change="onChange"/>’’ all dis。 ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:07:44 -05:00
yindo closed this issue 2026-02-21 19:07:44 -05:00
Author
Owner

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

Hello @ericWenjp! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve your issue.

Dify modifies content from external knowledge bases due to its built-in text preprocessing steps, specifically text chunking and text cleaning. These processes can lead to missing characters and unintended modifications, such as the partial deletion of HTML tag code blocks. To minimize these modifications, you can switch from automatic mode to custom mode, manually adjust chunking rules, define custom cleaning strategies, set specific delimiters, and configure maximum chunk lengths and chunk overlaps [1].

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 3, 2025): <!-- Greeting --> Hello @ericWenjp! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve your issue. <!-- Answer --> Dify modifies content from external knowledge bases due to its built-in text preprocessing steps, specifically text chunking and text cleaning. These processes can lead to missing characters and unintended modifications, such as the partial deletion of HTML tag code blocks. To minimize these modifications, you can switch from automatic mode to custom mode, manually adjust chunking rules, define custom cleaning strategies, set specific delimiters, and configure maximum chunk lengths and chunk overlaps <sup>[[1]](https://github.com/langgenius/dify/issues/11992)</sup>. <!-- 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/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=other)</sup>
Author
Owner

@ericWenjp commented on GitHub (Apr 3, 2025):

Hello @ericWenjp! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve your issue.

Dify modifies content from external knowledge bases due to its built-in text preprocessing steps, specifically text chunking and text cleaning. These processes can lead to missing characters and unintended modifications, such as the partial deletion of HTML tag code blocks. To minimize these modifications, you can switch from automatic mode to custom mode, manually adjust chunking rules, define custom cleaning strategies, set specific delimiters, and configure maximum chunk lengths and chunk overlaps [1].

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

I can't find the guidance on modifying the preprocessing rules to support the import of HTML tags in the task help documentation.can show me some help links?@dosu

@ericWenjp commented on GitHub (Apr 3, 2025): > Hello [@ericWenjp](https://github.com/ericWenjp)! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve your issue. > > Dify modifies content from external knowledge bases due to its built-in text preprocessing steps, specifically text chunking and text cleaning. These processes can lead to missing characters and unintended modifications, such as the partial deletion of HTML tag code blocks. To minimize these modifications, you can switch from automatic mode to custom mode, manually adjust chunking rules, define custom cleaning strategies, set specific delimiters, and configure maximum chunk lengths and chunk overlaps [[1]](https://github.com/langgenius/dify/issues/11992). > > _To continue talking to [Dosu](https://dosu.dev), mention [@dosu](https://github.com/dosu)._ > > Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c89444e6-eae9-44b9-b477-05f63d6ea616?feedback_type=other) I can't find the guidance on modifying the preprocessing rules to support the import of HTML tags in the task help documentation.can show me some help links?@dosu
Author
Owner

@ericWenjp commented on GitHub (Apr 7, 2025):

@dosu i need same help for deal this question,can somebody help me? i replace <> as < and >,can avoid this issue, but I want to know the specific reasons and why Dify is designed this way.

@ericWenjp commented on GitHub (Apr 7, 2025): @dosu i need same help for deal this question,can somebody help me? i replace <> as &lt; and &gt;,can avoid this issue, but I want to know the specific reasons and why Dify is designed this way.
Author
Owner

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

It seems like you're encountering issues with HTML tags being partially deleted when importing them into Dify's knowledge base. This is likely due to Dify's text preprocessing steps, which include text chunking and cleaning. These processes can sometimes lead to unintended modifications.

To address this, you can switch from automatic mode to custom mode, where you can manually adjust chunking rules, define custom cleaning strategies, set specific delimiters, and configure maximum chunk lengths and chunk overlaps .

If you're looking for more detailed guidance on modifying these preprocessing rules, could you provide more details about the specific settings or configurations you are using in Dify? Additionally, are there any specific error messages or logs that appear when the HTML tags are partially deleted? This information might help in understanding the issue better.

If you need further assistance, it might be helpful to loop in a maintainer. This is a tough nut to crack, could really use your help on this, @crazywoola.

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 7, 2025): <!-- Answer --> It seems like you're encountering issues with HTML tags being partially deleted when importing them into Dify's knowledge base. This is likely due to Dify's text preprocessing steps, which include text chunking and cleaning. These processes can sometimes lead to unintended modifications. To address this, you can switch from automatic mode to custom mode, where you can manually adjust chunking rules, define custom cleaning strategies, set specific delimiters, and configure maximum chunk lengths and chunk overlaps [[id=11992]]. If you're looking for more detailed guidance on modifying these preprocessing rules, could you provide more details about the specific settings or configurations you are using in Dify? Additionally, are there any specific error messages or logs that appear when the HTML tags are partially deleted? This information might help in understanding the issue better. If you need further assistance, it might be helpful to loop in a maintainer. This is a tough nut to crack, could really use your help on this, @crazywoola. <!-- 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/8bfb07d9-a6d1-405b-8902-e42338fafa22?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/8bfb07d9-a6d1-405b-8902-e42338fafa22?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/8bfb07d9-a6d1-405b-8902-e42338fafa22?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/8bfb07d9-a6d1-405b-8902-e42338fafa22?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8bfb07d9-a6d1-405b-8902-e42338fafa22?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/8bfb07d9-a6d1-405b-8902-e42338fafa22?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8bfb07d9-a6d1-405b-8902-e42338fafa22?feedback_type=other)</sup>
Author
Owner

@ericWenjp commented on GitHub (Apr 7, 2025):

@crazywoola can modify config file to deal my question in dify?

@ericWenjp commented on GitHub (Apr 7, 2025): @crazywoola can modify config file to deal my question in dify?
Author
Owner

@ericWenjp commented on GitHub (Sep 8, 2025):

Excuse me, will the subsequent Dify version fix the issue where part of the content with <> symbols gets lost when importing a knowledge base?

Dify version 1.2.0.

The original text is shown in the picture below:
Image

Image

The sharding configuration for importing the knowledge base is shown in the picture below:
Image

Image @crazywoola @appleboy @tomoyuki28jp @kindy

@ericWenjp commented on GitHub (Sep 8, 2025): Excuse me, will the subsequent Dify version fix the issue where part of the content with <> symbols gets lost when importing a knowledge base? Dify version 1.2.0. The original text is shown in the picture below: <img width="726" height="247" alt="Image" src="https://github.com/user-attachments/assets/93498b5e-b22c-4311-ae49-282da1f47d67" /> <img width="988" height="584" alt="Image" src="https://github.com/user-attachments/assets/3d3f7bc3-0a2f-41be-8f95-4284d8cd0684" /> The sharding configuration for importing the knowledge base is shown in the picture below: <img width="2536" height="1125" alt="Image" src="https://github.com/user-attachments/assets/28cb84e4-1a76-47cb-b285-b64433739a5e" /> <img width="2500" height="1380" alt="Image" src="https://github.com/user-attachments/assets/c6d00ac5-b29e-4e34-a6a7-6e5bb5412ef5" /> @crazywoola @appleboy @tomoyuki28jp @kindy
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12509