blocks-everywhere icon indicating copy to clipboard operation
blocks-everywhere copied to clipboard

Add switch to HTML editor

Open sybrew opened this issue 2 years ago • 3 comments

Allow users to switch between the Block editor and source (HTML) editing.

Related: https://meta.trac.wordpress.org/ticket/6608#comment:9

I think there should be an option to fill out a simple form. In my professional opinion, I think Gutenberg still requires a bit too much of a learning process to really get the hang of it as a keyboard user. Screen readers only further complicate this. Since there is also no options menu, there is no keyboard shortcuts list or any helpful guides for new users to WordPress. I am not sure this is the experience we should be giving users who are new to WP wanting to ask their questions.

And: https://meta.trac.wordpress.org/ticket/6608#comment:57

I prefer to write in plain HTML [...] -- please give power users the option to switch between blocks and HTML.

sybrew avatar Dec 19 '22 00:12 sybrew

This is an important feature for moderators to have access to. We often need to repair formatting issues in posts, usually code vs. plaintext. It can be difficult to do this in the blocks view. A HTML view is also very important to help us identify hidden spam links, like when they linkify a single period.

bcworkz-wp avatar Jan 24 '23 17:01 bcworkz-wp

Can you expand further on the formatting issues @bcworkz-wp - do you have an example?

johngodley avatar Jan 24 '23 18:01 johngodley

@johngodley - For example this topic: https://wordpress.org/support/topic/rewrite-rule-doesnt-work-for-urls-containing-underscores/ The OP obviously pasted in their entire post and the forum's auto-format pastes as code algorithm kicked in. With tinyMCE it was simple to add/remove some backticks and all is well. Without access to the underlying HTML, this post's formatting is time consuming and error prone to correct, so I didn't even bother.

The opposite happens as well, people add PHP/JS code, but do not format it as code or use the code block. Then wptexturize corrupts the code's quotes, making difficult to use the code in further testing. With tinyMCE we could access the original, untexturized code. Adding backticks prevented wptexturize from corrupting the code. I'm not sure we'll be able to so easily undo wptexturize in blocks even with HTML access.

Other poor HTML formatting like invalid ul/li structures used to happen. It seems the block editor is helping in this regard. But should it still happen it will be difficult to repair without access to the HTML.

bcworkz-wp avatar Jan 25 '23 21:01 bcworkz-wp