• As title, my site: https://burritobar.com.au/ using ACF Wysiwyg editor to insert content. And every time i save my edit, there are (” “) chracters (cause multi line break) auto add to my content. Please help me on this. Thanks you!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @thongnguyenminh,

    could you take a look at the “HTML” version of the Wysiwyg to check if it’s adding any special characters when typing the (“”) characters?

    Thread Starter thongnguyenminh

    (@thongnguyenminh)

    Hi @ibonazkoitia,

    thanks for response. Yes, it auto add the “none-breaking space” charracter ( ). I have already write it in my issue description – but i don’t know why it changed into a space. I guess because it’s a HTML entity, so i have added it above, in parentheses – with escape. Hope this help!

    Thanks again and have great day!

    Hi @thongnguyenminh,

    sometimes these kinds of characters are hard to work with. For example, it’s not the same ‘ character compared with ′.

    Also happens with “, sometimes is vertical and, in other situations, it has some inclination. If you see these support texts, those ” characters are not vertically straight.

    You may try to copy&paste the ” character from a website for example and paste it without format.

    I don’t know if that could be the reason… but just try it.

    Thread Starter thongnguyenminh

    (@thongnguyenminh)

    Thanks @ibonazkoitia i think i made you misunderstand me. I mean – when i edited my ACF Wysiwyg field. When i switch between “text” and “visual” tab or save my content, it keep adding   charracters to my content (this will make my content have lots of new lines in the front end).

    Sorry if my previous question not clearly and thanks for quick resopnse!

    @thongnguyenminh I made a solution with a post-save filter.

    //Remove white space at the end of wysiwyg strings
    add_filter('acf/update_value/type=wysiwyg', function($value){
    	//preg_replace below only works if the wpautop function has been run
    	$value = wpautop($value);
    	$value = force_balance_tags($value);
    	$value = preg_replace('/<p>(?:\s|&nbsp;)*?<\/p>/i', '', $value);
    	$value = trim($value);
    	return $value;
    });
    • This reply was modified 3 years, 8 months ago by kakitzmiller.
    • This reply was modified 3 years, 8 months ago by kakitzmiller.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Wysiwyg editor auto add none breaking space ” ” when saving’ is closed to new replies.