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

Text wrapped or partially wrapped in curly braces do not render #3165

Closed
stevkan opened this issue May 18, 2020 · 6 comments · Fixed by #4095
Closed

Text wrapped or partially wrapped in curly braces do not render #3165

stevkan opened this issue May 18, 2020 · 6 comments · Fixed by #4095
Labels
bug Indicates an unexpected problem or an unintended behavior. p1 Painful if we don't fix, won't block releasing
Milestone

Comments

@stevkan
Copy link
Contributor

stevkan commented May 18, 2020

Screenshots

image

image

Version

CDN 4.9.0

Describe the bug

If the text sent from the bot to the user is fully wrapped or partially wrapped in curly braces, then the text is not rendered.

For partially wrapped text, this only applies if it is NOT the first word(s) in the text. If it is the first word(s), then that text will render. However, any other wrapped words will not.

This is not reproducible using v4.8.0

Steps to reproduce

  1. Ensure Web Chat v4.9.0 is loaded
  2. Program bot to send a message that contains text wrapped in curly braces
  3. Connect to Web Chat and receive message from bot
  4. Observe wrapped text is missing

Expected behavior

Any text wrapped in curly braces should fully render as intended by the bot

Additional context

From bot: await stepContext.context.sendActivity('{Text sent by} the {bot}')

[Bug]

@stevkan stevkan added the bug Indicates an unexpected problem or an unintended behavior. label May 18, 2020
@tonyanziano
Copy link
Contributor

I was able to reproduce this using https://cdn.botframework.com/botframework-webchat/latest/webchat.js:

image

Bot code:

this.onMessage(async (context, next) => {
      const textWithBraces = 'Here is a message wrapped in curly braces: {Hello world!}';
      const textWithoutBraces = 'Here is a message without curly braces: Hello world!';

      await context.sendActivity(MessageFactory.text(textWithBraces, textWithBraces));
      await context.sendActivity(MessageFactory.text(textWithoutBraces, textWithoutBraces));

      await next();
});

@tonyanziano tonyanziano added the R11 label Sep 8, 2020
@corinagum corinagum added needs-team-attention needs-scheduling backlog Out of scope for the current iteration but it will be evaluated in a future release. front-burner and removed backlog Out of scope for the current iteration but it will be evaluated in a future release. needs-team-attention R11 labels Sep 23, 2020
@compulim compulim added the backlog Out of scope for the current iteration but it will be evaluated in a future release. label Oct 5, 2020
@corinagum corinagum added this to the R12 milestone Dec 21, 2020
@corinagum corinagum added needs-scope needs-team-attention p1 Painful if we don't fix, won't block releasing labels Jan 13, 2021
@cwhitten cwhitten removed this from the R12 milestone Jan 21, 2021
@cwhitten
Copy link
Member

@stevkan did this come from a customer?

@stevkan
Copy link
Contributor Author

stevkan commented Jan 22, 2021

@cwhitten, no, I believe I was helping a customer with another issue when I stumbled across this. However, in doing a quick search, I see what looks like a similar issue filed by a Cx in the Emulator repo, #2192.

@chrimc62
Copy link

chrimc62 commented Feb 5, 2021

This is a very annoying bug that has been reported by me and others--is it really that hard to fix? No one can generate output with curly braces.

@amal-khalaf amal-khalaf self-assigned this Feb 16, 2021
@compulim
Copy link
Contributor

compulim commented Feb 19, 2021

It only affect the very last curly braces.

We added a feature to Markdown-It to support accessibility by adding a syntax using curly braces, in #3022. The feature is designed to add aria-* attributes to make the activity content more accessible, especially for anchors.

Unfortunately, it also impact the last curly braces on the line. For example:

abc {xyz}

Will become

<p xyz="">abc</p>

When we import/use the markdown-it-attrs package in /packages/bundle/src/renderMarkdown.js, we should scope it down to /^aria-/iu.

@compulim compulim added the size-s 1 days or less label Mar 10, 2021
@Kaiqb Kaiqb added this to the R13 milestone Mar 10, 2021
@compulim
Copy link
Contributor

compulim commented Mar 10, 2021

@corinagum

First, look at markdown-it-attrs and use this options:

image

Use RegExp to filter to allow only `/^aria-/iu/.

Add tests:

  • aria-xyz will be added
  • data-abc will NOT be added

@corinagum corinagum self-assigned this Mar 10, 2021
@corinagum corinagum removed size-s 1 days or less needs-scope backlog Out of scope for the current iteration but it will be evaluated in a future release. front-burner labels Mar 26, 2021
@Kaiqb Kaiqb modified the milestones: R13, Post-R13 Mar 30, 2021
@corinagum corinagum modified the milestones: Post-R13, R14 Apr 26, 2021
@compulim compulim modified the milestones: R14, Post-R13, R15 Jun 16, 2021
@compulim compulim removed this from the R15 milestone Jun 29, 2021
@compulim compulim added this to the R15 milestone Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. p1 Painful if we don't fix, won't block releasing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants