Markdown h2 and default html h2 have different text effect behaviors

Reproduction Steps
Create a new topic, inside of the topics content add in an <h2> html element and try to use preformatted text or bolding while the text is 1 line under the h2 tag. This does not apply when you add a header using markdown(##) or when you put the text farther than one line away from the h2 tag.

Example below;

h2 tag

`preformatted text` **meant to be bolded**

although if I put it under a couple lines like this: works! it’ll work just fine.

markdown h2

this is bolded even when 1 line away. Unlike when 1 line away from the h2 tag

Expected Behavior
I expect consistent text effect behavior between h2 tags and markdown h2.

Actual Behavior
text effects dont apply when 1 line under from a <h2> tag. But text effects work fine when 1 line away from markdown h2.

Issue Area: Forum topic create
Page URL: Memory Store Service Tutorial
Impact: low
Frequency: Constantly
Browser: Chrome Version 99.0.4844.84 (Official Build) (64-bit)
Date First Experienced: 2022-03-25 00:03:00 (-04:00)
Date Last Experienced: 2022-03-25 00:03:00 (-04:00)

2 Likes

Bug test

**bold text**

Edit: You’re right.

As shown above in this reply, I can confirm this bug.

Edit 2: Yep. This is a bug.

1 Like

you did it wrong. You dont do ###. You do <h2> </h2>

so like this

why

**BOLD ME UP**
3 Likes

h1

**h1 no work :( ** emojis dont work either :(

h2

**h2 no work :( ** emojis dont work either :(

h3

**h3 no work :( ** emojis dont work either :(

Also this is an issue with all html header tags.

1 Like

I would assume this is the same with the Talent Hub. (I know it supports markdown, not sure about html)

hmm. Might want to test it out.

1 Like

This is intentional, the way HTML works.

markdown markdown

html html

The same with any html tag

*html* html

image

<h2><strong>html <i>html</i></strong></h2>

is the code

Thanks for the feedback!

This is actually an expected behavior of markdown. Markdown uses blank lines to identify paragraphs. If there is no blank line between subsequent lines of markdown, then they are collapsed into the same paragraph/parent element.

This is why something like the following lines, although typed on their own lines, wrap into the same parent.

This code

<h2>h2 tag</h2>
`preformatted text`
**meant to be bolded**

Results in

<div class="cooked">
  <h2>h2 tag</h2>
  `preformatted text`
  **meant to be bolded**
</div>

However, if you add a blank line between the h2 element and the markdown lines it will tell the parser to treat the markdown as its own paragraph. Notice how it wraps paragraphs with<p>...</p>.

This code

<h2>h2 tag</h2>

`preformatted text`
**meant to be bolded**

Results in

<div class="cooked">
  <h2>h2 tag</h2>
  <p>
    <code>preformatted text</code>
    <br>
    <strong>meant to be bolded</strong>
  </p>
</div>

I’d suggest just adding a blank line around the markown and it will behave just as you expect!

If this, or any of the above posts are helpful, don’t forget to click “Mark as Solution”!

3 Likes