Eg. "$10 and $20" in ouput results in canvas formatting bug #7951

Closed
opened 2026-02-21 18:23:12 -05:00 by yindo · 4 comments
Owner

Originally created by @infinitnet on GitHub (Feb 2, 2025).

Originally assigned to: @Riddhimaan-Senapati 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

v0.15.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Get any Chat or Workflow to output eg. between $10 and $20 or just $10 and $15 or similar and the output will be broken and show as eg. 10and20. Screenshot: https://i.postimg.cc/7Y1H5Jvn/Screenshot-at-Feb-02-13-06-31.png

✔️ Expected Behavior

Output canvas in chat and workflows should output $10 and $15 as $10 and $15.

Actual Behavior

Output canvas in chat and workflows outputs $10 and $15 as a 10and15 formula, see https://i.postimg.cc/7Y1H5Jvn/Screenshot-at-Feb-02-13-06-31.png

Originally created by @infinitnet on GitHub (Feb 2, 2025). Originally assigned to: @Riddhimaan-Senapati 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 v0.15.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Get any Chat or Workflow to output eg. `between $10 and $20` or just `$10 and $15` or similar and the output will be broken and show as eg. `10and20`. Screenshot: https://i.postimg.cc/7Y1H5Jvn/Screenshot-at-Feb-02-13-06-31.png ### ✔️ Expected Behavior Output canvas in chat and workflows should output `$10 and $15` as `$10 and $15`. ### ❌ Actual Behavior Output canvas in chat and workflows outputs `$10 and $15` as a `10and15` formula, see https://i.postimg.cc/7Y1H5Jvn/Screenshot-at-Feb-02-13-06-31.png
yindo added the 🐞 buggood first issue labels 2026-02-21 18:23:12 -05:00
yindo closed this issue 2026-02-21 18:23:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 2, 2025):

The issue you're experiencing with the output canvas formatting special characters like '$' seems to be a bug in the rendering process. Unfortunately, I couldn't find specific information in the Dify repository about how special characters are handled in the output rendering process or any known issues related to this.

However, there are existing tests for output formatting in chat and workflows that ensure prompt templates and messages are correctly formatted [1][2]. These tests might not cover the specific case of special characters like '$', which could be why this issue is occurring.

To address this, you might want to check the code responsible for rendering the output canvas and see if there are any specific functions or methods that deal with formatting special characters. Additionally, reviewing the configuration settings related to character processing might provide some insights.

If you have access to the codebase, you could look into the rendering logic to identify where the formatting might be going wrong. Alternatively, you could consider adding a test case that specifically checks for the correct rendering of monetary values or special characters to help identify and fix the issue.

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Feb 2, 2025): <!-- Answer --> The issue you're experiencing with the output canvas formatting special characters like '$' seems to be a bug in the rendering process. Unfortunately, I couldn't find specific information in the Dify repository about how special characters are handled in the output rendering process or any known issues related to this. However, there are existing tests for output formatting in chat and workflows that ensure prompt templates and messages are correctly formatted <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/tests/unit_tests/core/prompt/test_simple_prompt_transform.py)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/web/app/components/base/chat/__tests__/utils.spec.ts)</sup>. These tests might not cover the specific case of special characters like '$', which could be why this issue is occurring. To address this, you might want to check the code responsible for rendering the output canvas and see if there are any specific functions or methods that deal with formatting special characters. Additionally, reviewing the configuration settings related to character processing might provide some insights. If you have access to the codebase, you could look into the rendering logic to identify where the formatting might be going wrong. Alternatively, you could consider adding a test case that specifically checks for the correct rendering of monetary values or special characters to help identify and fix the issue. <!-- 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/26add4f4-d504-4917-b511-041daad0b5c4?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/26add4f4-d504-4917-b511-041daad0b5c4?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/26add4f4-d504-4917-b511-041daad0b5c4?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/26add4f4-d504-4917-b511-041daad0b5c4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/26add4f4-d504-4917-b511-041daad0b5c4?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/26add4f4-d504-4917-b511-041daad0b5c4?feedback_type=other)</sup>
Author
Owner

@Riddhimaan-Senapati commented on GitHub (Feb 3, 2025):

I would like to take this issue @crazywoola can you tell me where in the repo I should make changes.

@Riddhimaan-Senapati commented on GitHub (Feb 3, 2025): I would like to take this issue @crazywoola can you tell me where in the repo I should make changes.
Author
Owner

@crazywoola commented on GitHub (Feb 3, 2025):

@Riddhimaan-Senapati :)

Here you go.

https://github.com/langgenius/dify/blob/b8ba39dfae84dc8f1682182286d6c07fb685413d/web/app/components/base/markdown.tsx

@crazywoola commented on GitHub (Feb 3, 2025): @Riddhimaan-Senapati :) Here you go. https://github.com/langgenius/dify/blob/b8ba39dfae84dc8f1682182286d6c07fb685413d/web/app/components/base/markdown.tsx
Author
Owner

@Riddhimaan-Senapati commented on GitHub (Feb 3, 2025):

@crazywoola created a PR for this issue.

@Riddhimaan-Senapati commented on GitHub (Feb 3, 2025): @crazywoola created a PR for this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7951