Continuing the discussion from Date selector in Topic Timer :
Problem
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 (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!
<abbr title="Coordinated Universal Time">UTC</abbr>
[date=2018-06-28 time=07:00 format=“HH:mm” timezones=“Europe/Brussels”]  [date=2018-06-28 time=15:00 format=“HH:mm” timezones=“Europe/Brussels”]
fails to render:
UTC
07:00 15:00
Solution
Avoid using HTML tags in Markdown – Or maybe implement <abbr> in CommonMark .
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.
Why do you need to use an emoji arrow? Use →
I simply pasted the result I got from using the ‘Insert Date’ button. The emoji transformation must be part of the cooking.
Edit: here is pasted the original character (or ➡ with backquotes)
Edit:
'➡'.unpack('U*')
=> [10145]
j.jaffeux
(Joffrey Jaffeux)
28.Июнь.2018 22:14:10
4
Yes ➡ will be cooked as an emoji
I will give it a look to this tomorrow.
Test:
A
07:00
2 лайка
j.jaffeux
(Joffrey Jaffeux)
04.Июль.2018 21:50:09
5
Это на самом деле не связано с вставкой даты. Это ограничение textPostProcess.
Например, это также не сработает с категориями: первая сработает, всё, что идёт после abbr, не сработает (как упоминал @sam ):
Contribute > Feature
<abbr>A</abbr>
A
Contribute > Feature
Мне кажется, что следующий блок после abbr будет преобразован в абзац и не будет обработан textPostProcess. Это поведение нашего санитайзера https://github.com/discourse/discourse/blob/master/test/javascripts/lib/sanitizer-test.js.es6#L117:
@sam , есть ли у вас какие-нибудь идеи по этому поводу? Как вы думаете, стоит ли это исправлять? На мой взгляд, это очень и очень редкий случай.
sam
(Sam Saffron)
04.Июль.2018 22:16:44
6
Something is not right internally cause <small> does not cause this issue nor does <sub> or <ins> or <kbd>
I am guessing this is something internally is broken in sanitizer that is specific to this inline tag. Probably worth fixing.
sam
(Sam Saffron)
04.Июль.2018 23:28:24
7
4 лайка
sam
(Sam Saffron)
Закрыл(а) тему
06.Июль.2018 08:00:00
8
This topic was automatically closed after 32 hours. New replies are no longer allowed.