microsoft / microsoft/BotFramework-WebChat
Cards: unable to render D. M. YYYY date properly
@Kaiqb is already working on this.
Since Jan 13, 2021.
- 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):

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


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:
-
Connect your bot to proper channel registration
-
Start Bot Framework Emulator or deploy web chat to a website
-
Make sure your regional settings are European D. M. YYYY
-
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); -
Send it to user
-
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.