-
Notifications
You must be signed in to change notification settings - Fork 217
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
[bug] wp-editor not adding brakes on first save #2397
Comments
I tried to do , Also the p is trouble inside headings , so there is no way to fix any of the issues until wpautop is fixed and we either get new line or brakes not both and not different on every save. |
No need to save the post, it happens on modal save https://sendvid.com/zjlvgc0u I haven't figure out a solution yet. |
Please test |
ok I see you did try replacing it here maybe this one works better ? |
@moldcraft and this text/ visual tab bug , please see this till end tab works on first load until you save the popup, once you save popup and reopen tabs dont work anymore |
When autop is off there are no This code is executed once on editor init. |
Tabs work fine on my side. Please check browser console, maybe there is an error. |
there are no errors I am looking at it , see the video please , you must save the popup to see the bug , not just open/close |
I have saved it many times. |
ok fixed the tab , it was my typography option had this on doc click autop is false do this on line 84
I see this but output is so I have to accommodate and check if br is there if not do nl2br what I am sayings that when autop is false , we should replace new lines with brakes |
Initially I set the editor content with
It should be always without br
Yes. |
im bit lost now but all I am trying to do is match the visual to the output and currently we dont have that unless we massage the output so if you have autop false and to this
your output is this
if autop is true visual
output
in my opinion autop false should produce this
since autop false does not mean strip all tags but strip p tag |
autop is a WP feature, you should contact WP core devs to ask for feature requests. This this in browser console var text = "Hello\r\nWorld\r\nFoo",
textautop = wp.editor.autop(text);
console.log(textautop);
console.log(wp.editor.removep(textautop)); output
|
cmon man dont be so harsh , I am trying to make sense out of it and you must admit that it makes no sense to see one thing in editor and get different result |
I tried to disable auto for default post content editor via this filter add_filter('tiny_mce_before_init', function ($mceInit) {
$mceInit['wpautop'] = false;
return $mceInit;
}); but it doesn't disable autop. In js the parameter is set tinyMCEPreInit.mceInit['content'].wpautop I tried to disable autop for default editor to show that it works the same as I described above (without br) |
Video
https://monosnap.com/file/H664TMolqSEzHyTEs76zqi1o7p2Ghg
options to test
on first save I get this
on second save I see brakes and even the p ,
as you can see in option
wpautop
isfalse
the wpautop has been lingering around this option since the first release.
It would be great to be fixed once and for all.
#1621
The text was updated successfully, but these errors were encountered: