# "Insert Date" rendering may break when mixed with HTML

**URL:** <https://meta.discourse.org/t/insert-date-rendering-may-break-when-mixed-with-html/90959>\
**Category:** Bug\
**Created:** [June 28, 2018, 3:20pm UTC](https://meta.discourse.org/t/insert-date-rendering-may-break-when-mixed-with-html/90959 "2018-06-28T15:20:47Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)\
**Post date:** [June 28, 2018, 3:20pm UTC](https://meta.discourse.org/t/insert-date-rendering-may-break-when-mixed-with-html/90959/1 "2018-06-28T15:20:47Z")

</div>

Continuing the discussion from [Date selector in Topic Timer](https://meta.discourse.org/t/date-selector-in-topic-timer/90335/4):

> [@j.jaffeux](#):
>
> You can try to “insert date” in the composer gear icon

## Problem

 ![2018-06-28-170215](https://global.discourse-cdn.com/meta/original/3X/d/f/dfb1ea3828865d05e5bb1fbb68d4ca63b1e0c50f.png)

I tried to reproduce here, using multiple dates, and inserting code fences blocks, but it didn’t reproduce until  
[https://try.discourse.org/t/testing-insert-date-bug/1130/2](https://try.discourse.org/t/testing-insert-date-bug/1130/2) (this link will become obsolete by tomorrow, but it shows like the screenshot above.)

## Cause

Finally I found the cause of the bug: the failing render follows an HTML tag with an attribute!

```markdown
<abbr title="Coordinated Universal Time">UTC</abbr>

[date=2018-06-28 time=07:00 format=“HH:mm” timezones=“Europe/Brussels”] ![:arrow_right:](//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/5/a/5aa33b89419423f0712cf1e6c72f0813cb3f082c.png) [date=2018-06-28 time=15:00 format=“HH:mm” timezones=“Europe/Brussels”]

```

fails to render:

UTC

07:00 ![:arrow_right:](https://global.discourse-cdn.com/meta/original/3X/5/a/5aa33b89419423f0712cf1e6c72f0813cb3f082c.png) 15:00

## Solution

Avoid using HTML tags in Markdown – Or maybe [implement \<abbr\> in CommonMark](https://talk.commonmark.org/t/abbreviations-and-acronyms/890). 🙂

I suppose that an HTML tag appearing in a previous paragraph should not affect rendering later on though.

**In any case: when things fail, check for a mix of HTML and Markdown.**

---

_[View the full topic](https://meta.discourse.org/t/insert-date-rendering-may-break-when-mixed-with-html/90959)._
