Opened 7 years ago
Closed 5 years ago
#43486 closed feature request (worksforme)
The Problem with HTML and wpautop
Reported by: | jim5471 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | TinyMCE | Keywords: | |
Focuses: | Cc: |
Description
Most editors use the VISUAL mode in The TinyMCE editor but there are a minority of editors who use the TEXT mode.
The TEXT mode allows editors to input raw HTML code.
If they program in HTML4 then wpautop reformats the code and sometimes introduces paragraph errors.
HTML5 is a greater problem and should be avoided.
wpautop can be turned off but this is not a realistic solution in a multi-user situation.
I would like to propose this easy modification as a possible solution.
- Editors who want to turn off wpautop should insert "[WPAUTOP-OFF]" at the top of their script.
- wp-includes/formatting.php should be changed with this additional code
LINE 439 function wpautop( $pee, $br = true ) { /* * If "[WPAUTOP-OFF]" is present in $pee then * return $pee with "[WPAUTOP-OFF]" removed and no other changes */ if ( false !== strpos( $pee, "[WPAUTOP-OFF]" ) ) { $pee = str_replace("[WPAUTOP-OFF]", "", $pee); return $pee; }
Change History (4)
#2
in reply to:
↑ 1
@
7 years ago
Replying to SergeyBiryukov:
There are plugins like Raw HTML that might be helpful.
Thanks Sergey - I hadn't seen that before - number of users shows the scale of the issue
#4
@
5 years ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
This is now superseded by the block editor. It still uses wpautop sometimes in classic blocks, but hoping this can be fixed completely.
Closing as worksforme as wpautop can be (easily) disabled by plugins and is not used in the block editor.
Hi @jim5471, welcome to WordPress Trac! Thanks for the ticket.
There are plugins like Raw HTML that might be helpful.