Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: selecting heading style toggles between heading and paragraph style #1706

Closed
martinremy opened this issue Dec 16, 2015 · 2 comments
Closed
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. [Type] Bug When a feature is broken and / or not performing as intended

Comments

@martinremy
Copy link

What I did: created a new post that had some headings (Heading 3) and some paragraph text.

What I expected: When I select "Heading 3" for text that is already "Heading 3", that text should remain as "Heading 3".

What actually happened: The text turned into "Paragraph". I would expect that click to be a no-op, since the style is already Heading 3, but "Heading 3" effectively functions as a toggle between Heading 3 and Paragraph.

I also noticed that in my particular document, Heading 3 was sometimes bold and sometimes not (not with "B" selected, but just appearing bold).

@martinremy martinremy added the [Feature] Post/Page Editor The editor for editing posts and pages. label Dec 16, 2015
@designsimply designsimply added the [Type] Bug When a feature is broken and / or not performing as intended label Dec 17, 2015
@designsimply
Copy link
Contributor

What I expected: When I select "Heading 3" for text that is already "Heading 3", that text should remain as "Heading 3".

I tested at https://www.tinymce.com/ and found the same behavior there. It appears re-selecting the same format again will toggle it on or off by design, see tinymce/tinymce#768

I also noticed that in my particular document, Heading 3 was sometimes bold and sometimes not (not with "B" selected, but just appearing bold).

This sounds possibly like a case of #1601 where the content was copied from another web page or app and may have pulled in some underlying markup along with it when the text was copied. Do you think that might have been the case?

@designsimply
Copy link
Contributor

I reviewed the original post and found that the first heading was something like:

<h3>The First Heading</h3>

While the second heading was something like:

<h3><span style="font-weight:400;">The Second Heading</span></h3>

And that explains why headings were sometimes bold and sometimes not in the WordPress.com editor where a change in font weight is noticeably different in that context. I chatted with @martinremy and confirmed that part of the issue is a duplicate of #1601.

We also discussed tinymce/tinymce#768 and based on that ticket we agreed that re-selecting "Heading 3" is intended to toggle that formatting on/off and so while that behavior does not match other editors such as Pages, it is the intended behavior in TinyMCE.

Closing this as a duplicate, and adding a thank you for reporting the issue and working through the details with me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

No branches or pull requests

2 participants