microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.47k stars 2.44k forks source link

What Markdown rules is changing multiple exclamation mark to just !!! (three) and other similar behaviors #6564

Closed alexinuk closed 1 year ago

alexinuk commented 1 year ago

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

Latest

Describe the bug

When a message activity, default options, so textFormat should be MD, has a text value that contains more than three of some "special" characters, ! as well as . have been noticed, either Emulator as well as Webchat will change the representation to just three character (such as !!! or ..., even if the message contains hundreds of those chars).

Given that there shouldn't be standard MD behaviors for what I'm seeing, AFAIK, where I can get a list of those modification that are happening?

To Reproduce

Steps to reproduce the behavior:

  1. Create a simple sample bot
  2. Send a message activity back to the user that contains multiple dots or exclamation marks, more than 3 at least
  3. Run the bot and receive the new message, either through emulator or webchat
  4. Message will be displayed with only three characters, instead of the hundreds sent

Expected behavior

We were not expecting this behavior as part of standard MD behavior, so we need to understand what are the rules here.

Screenshots

<N/A>

Additional context

<N/A>

Tracking Status

Dotnet SDK [TODO]()

Javascript SDK [TODO]()

Python SDK [TODO]()

Java SDK [TODO]()

Samples [TODO]()

Docs [TODO]()

Tools [TODO]()

stevkan commented 1 year ago

@alexinuk - This is expected behavior. Web Chat uses the markdown-it package for MD support. Looking at their code, it looks like they replace multiple characters with just three of that kind (ref markdown-it/replacement.js.

alexinuk commented 1 year ago

lovelly thank you. Was that referenced anywhere else? We couldn't find a direct connection. Thanks a ton, Alessio

stevkan commented 1 year ago

@alexinuk - No, not that I came across, at least. There is a way to pass in a custom markdown engine (ref this issue on how to do this). So, in theory, you could pass in different parameters or a different engine that better suits your needs.

compulim commented 1 year ago

Thanks @stevkan. This is correct.

Markdown-It is doing a lot of weird things outside of their scope by default. 😢

Sometimes, a library passing a standard test suite doesn't mean they are holding that standard.