HanByul Lee
HanByul Lee

Reputation: 351

Can I change tinymce behavior of wrapping text with semantic tags such as <strong> or <em>?

guys.

I need some helps about tinymce.

I'd like to do as like below with tinymce. (I want to do)

<strong>Entire words are bold.</strong>
<strong><em>But this is italic.</em></strong>
<strong>I'm still bold!</strong>

However, while I have done with tinymce, I'm getting

<strong>Entire words are bold.
<em>But this is italic.</em>
I'm still bold!</strong>

This would be happen when making all text bold, and then make part of text italic.

Here are what I tried to set

style_formats: [{title: 'Bold text', inline: 'strong'},
                {title: 'Italic text', inline: 'em'}]

or

formats: {
    bold: {inline: 'strong'},
    italic: {inline: 'em'}
}

and so on...

Is there any option or hack to achieve this?

Upvotes: 1

Views: 156

Answers (1)

user7881930
user7881930

Reputation:

Correct me if I'm wrong, but is this the course of action you're taking to bold/italicize your content?

  1. Highlight all text.
  2. Press the bold button.
  3. Highlight the second line.
  4. Press the italic button.

The default behaviour should be that each line is wrapped in its own <strong> tag. You might want to check if you have Style Merging enabled - this may be causing what you're experiencing.

Upvotes: 1

Related Questions