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

Visual Editor: HTML Tags Visible in Post Title #60482

Open
akmyta opened this issue Apr 4, 2024 · 13 comments
Open

Visual Editor: HTML Tags Visible in Post Title #60482

akmyta opened this issue Apr 4, 2024 · 13 comments
Labels
[Block] Post Title Affects the Post Title Block Needs Design Feedback Needs general design feedback. [Type] Feedback Issues that relate purely to feedback on a feature that isn't necessarily actionable

Comments

@akmyta
Copy link

akmyta commented Apr 4, 2024

Description

Since the most recent update, adding HTML tags in the visual editor no longer work.
Not only will it not apply the requested HTML but also appears visibly in the published post title.

Previously, it was possible to add HTML tags in the visual editor.
HTML tags do appear as expected when inputted in the code editor.

Step-by-step reproduction instructions

  1. Create a new post (in visual editor) with HTML-Tags in the title for example: "This is my title"
  2. Save and publish the post with this title
  3. Review post and see that it has published with HTML-tags visible

Screenshots, screen recording, code snippet

This is how it would look in the visual editor:
html-tag1

This is the expected outcome:
html-tag3

And this was the actual result:
html-tag2

Environment info

  • WordPress Version: WordPress 6.5
  • Browser: Latest Chrome and Firefox browser
  • Device: MacOS latest version

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@akmyta akmyta added the [Type] Bug An existing feature does not function as intended label Apr 4, 2024
@jordesign jordesign added Needs Testing Needs further testing to be confirmed. [Block] Post Title Affects the Post Title Block labels Apr 4, 2024
@talldan
Copy link
Contributor

talldan commented Apr 5, 2024

Previously, it was possible to add HTML tags in the visual editor.

@akmyta I think HTML tags have to be added via the code editor and not the visual editor. Possibly this was changed at some point, but I'm not exactly sure of the history.

I've tested, and adding tags is possible if you do it via the code editor. Via the visual editor the tags are escaped.

@dansinker
Copy link

Possibly this was changed at some point, but I'm not exactly sure of the history.

This was not the case prior to 6.5's rollout this week. Has disrupted our editorial workflow significantly.

@akmyta
Copy link
Author

akmyta commented Apr 5, 2024

@talldan If I complete the same steps in WordPress version 6.4.3 - it works as expected.

htmltags.mp4

@t-hamano
Copy link
Contributor

t-hamano commented Apr 6, 2024

I researched this issue via Playground and it works as expected from WP6.1 to WP6.4. In WP6.5, HTML tags are escaped. I don't yet know if this is an intentional change.

@t-hamano
Copy link
Contributor

t-hamano commented Apr 6, 2024

I have confirmed that this change was intentional and was made by #54718.

The main purpose seems to be to match the look of the title in the editor and the frontend. It's also mentioned that we can't add or edit HTML in visual mode, so perhaps the ideal approach would be to implement a formatting toolbar in the title.

@talldan talldan added Needs Design Feedback Needs general design feedback. [Type] Feedback Issues that relate purely to feedback on a feature that isn't necessarily actionable and removed [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. labels Apr 8, 2024
@talldan
Copy link
Contributor

talldan commented Apr 8, 2024

IMO, the change takes things in the right direction. It makes more sense to add the tags in the code editor view, since that's where html is generally added, and it's now also possible to view the result of the html tags in visual mode.

As @t-hamano mentioned, it's perhaps an issue that there's no way to add formatting visually and some users may have the code editor disabled. Perhaps we keep this issue open to discuss that aspect?

I've removed the bug label since it works as intended currently.

@t-hamano
Copy link
Contributor

t-hamano commented Apr 8, 2024

It might be better to keep this issue open as an "Enhancement" that adds a formatting toolbar to the post title when in visual mode.

@dansinker
Copy link

Yeah, keeping this open for discussion on adding a formatting toolbar to the post title is great.

So you understand the use-case here:

Proper formatting of titles (books, albums, movies, etc) is to italicize them. The publication I work for has covered culture for 50 years, and regularly italicizes titles in their headlines (happened 3-4 times the day after the 6.5 update and nobody knew what was happening). Asking our editors to fire up the code editor to do something that should be part of normal editorial workflow seems like a lot, not to mention that inevitibly they will break something in the process.

@talldan
Copy link
Contributor

talldan commented Apr 9, 2024

Asking our editors to fire up the code editor to do something that should be part of normal editorial workflow seems like a lot, not to mention that inevitibly they will break something in the process.

@dansinker Another option is to use 'Quick Edit' from the post list to add the formatting, not sure if that's any easier.

@dansinker
Copy link

@talldan yes, that's what we've instructed them to do, but it's still a slower process than what they had before. ultimately it really does seem like if the idea is that the visual editor should allow for visual editing only, then adding visual editing to the title is the correct solution.

@MadtownLems
Copy link

+1 to the idea of the Post Title box having a basic toolbar for formatting, such as Italics. Our users don't have the ability to access Code Editor, but still need to be able to use italics (for things like the scientific name of plants). Thanks @talldan so much for the suggestion of using Quick Edit as a workaround for now!

@HeinMynn
Copy link

+1 for the formatting toolbar for the Post Title.

@dlh01
Copy link
Contributor

dlh01 commented May 12, 2024

I've observed since updating to 6.5 that the & character is converted to & in the post title as soon as it's typed, regardless of the user's role or capabilities. The encoded character then gets saved to the database.

Having & converted by KSES on save for users without the necessary capabilities has been a longstanding problem (see #20490), but this seems different.

I'm not positive that this change in behavior is caused by the same change being discussed here, so feel free to direct my comment to a better place if there is one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Title Affects the Post Title Block Needs Design Feedback Needs general design feedback. [Type] Feedback Issues that relate purely to feedback on a feature that isn't necessarily actionable
Projects
None yet
Development

No branches or pull requests

8 participants