Emoji displaying as code when mixing html and markdown


(pjv) #1

See here:

Other emojis are working fine on the same site. Looks like maybe the arrow emojis were changed recently? Could that be related?

Running version 1.9.0.beta13


(Jeff Atwood) #2

Let’s see

:arrow_upper_right: looks fine to me


(pjv) #3

excellent, it works on meta.


(pjv) #4

in case the sarcasm was too subtle, though :arrow_upper_right: works here on meta, it’s still not working for me.

anyone have any idea what i might try to fix it?


(Stephen Chung) #5

:joy:

It was too subtle.

F12 and see what image URL is showing up for the emoji?


(pjv) #6

What should F12 do and in what context?

The page’s HTML shows no image URL at all. Just text.


(Stephen Chung) #7

Find the place where the emoji icon should be and see if the image DOM node is there


(pjv) #8

Here is a test case that works / doesn’t work on meta.

H3 Heading

Some text with an emoji :slight_smile:

Is it a bug now?

The fix i just discovered is to use markdown ### instead of the <H3> html element. But still seems like a rendering bug to me.


(Stephen Chung) #9

Ah. You mean your emoji code is not being cooked into actual emoji’s.


(Joshua Rosenfeld) #10

So the raw content @pjv is using is:

<H3>H3 Heading</H3>
Some text with an emoji :slight_smile:

which produces

H3 Heading

Some text with an emoji :slight_smile:

Adding a blank line resolves the issue. Raw:

<H3>H3 Heading</H3>

Some text with an emoji :slight_smile: 

which produces

H3 Heading

Some text with an emoji :slight_smile:


Markdown headers work:

### H3 Heading
Some text with an emoji :slight_smile:

H3 Heading

Some text with an emoji :slight_smile:


(Stephen Chung) #11

There are obviously strange stuff going on when the <h3> tags are used.

Without a blank line, the cooked HTML does not get wrapped in <p> tags. With a blank line, the text gets wrapped in <p>.

Which seem strange because, all text should really be wrapped in <p> tags at the topmost level.

I’ve occasionally seen cooked HTML where text is not wrapped in <p> but they don’t happen too often. Can’t seem to find the pattern that will cause it to happen.


(Jeff Atwood) #12

Don’t randomly mix html and markdown for no reason, that is a recipe for pain. Use the markdown headings.

See Markdown Reference to learn more.


Image doesn't show when using html in a topic
(Sam Saffron) #13

Yeah, I don’t consider this a bug, this is a sure path to creating a monster unmaintainable nightmare mode parser.

HTML blocks have very clear semantics in CommonMark and treating them as paragraphs just because of this is not a world of pain I want to enter.

You can mix html inline and it works just fine :astonished:

You can mix html <b>inline</b> and it works just fine :astonished:

When you define a block of HTML you only break out of it properly after an empty line.


(Stephen Chung) #14

Ah. Now that makes sense.

All the lines, including the text after, are treated as raw HTML until a blank line is encountered.