microsoft / microsoft/BotFramework-WebChat

Cards: unable to render D. M. YYYY date properly

Open
#2,128 20 comments 0 reactions 1 assignee View on GitHub

@Kaiqb is already working on this.

Since Jan 13, 2021.

backlog blocked Bot Services bug customer-replied-to customer-reported external-adaptive-cards front-burner needs-scope needs-team-attention p1 technical-debt
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

Screenshots

When Title or Subtitle in HeroCard starts with date in European format (D. M. YYYY):

image

It gets evaluated with Markdown as ordered list and produces wrong HTML:

image

image

Version

  • webchat-stable
  • Bot Framework emulator

Describe the bug

When Title or Subtitle in HeroCard begins with date in the form of D. M. YYYY it's recognized as Markdown ordered list and rendered completely out of place (see screenshots).

To Reproduce

Steps to reproduce the behavior:

  1. Connect your bot to proper channel registration

  2. Start Bot Framework Emulator or deploy web chat to a website

  3. Make sure your regional settings are European D. M. YYYY

  4. Generate a Hero Card and set Title and/or Subtitle to today's date

    var reply = stepContext.Context.Activity.CreateReply();
    var card = new HeroCard
    {
        Title = string.Format(DateTime.Now.ToShortDateString()),
        Subtitle = DateTime.Now.ToShortDateString(),
    };
    
    reply.Attachments.Add(card.ToAttachment());
    await stepContext.Context.SendActivityAsync(reply);
    
  5. Send it to user

  6. See incorrect display in Web Chat

Expected behavior

Date should be displayed properly, not as an ordered list.

Additional context

Workaround: Prepend date with invisible character ⁣

[Bug]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.