Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Meitar

    (@meitar)

    Newlines do translate to a line break in the HTML on all the Spreadsheets I’ve tested. Make sure you do not have some CSS or other code running that changes the display of line breaks in tables.

    If you’re sure no such other code is running, show me the spreadsheet you’re using and I’ll try to find what’s going on with it.

    Thread Starter patsky

    (@patsky)

    Meitar Thanks for the quick response. I’m pretty sure nothing is conflicting and I’ve sent you an email.

    Best wishes
    Pat

    Plugin Author Meitar

    (@meitar)

    For those still reading, version 0.8.3 of the plugin is an update released to more intuitively handle white space character sequences in Google Spreadsheets. The TL;DR of this issue is that certain sequences (like space-newline instead of just newline) caused the later white space characters to be ignored due to the HTML specification’s definition of white space parsing rules and WordPress’s correct adherence to those rules. Version 0.8.3 fixes this issue by checking more closely for newline characters and doing the intuitive thing, rather than the stricter, more literal thing, when it encounters them.

    Thread Starter patsky

    (@patsky)

    Meitar you are a genius and I cannot believe the speed with which you have responded and solved this for me. I have written a review and will be donating very soon. THANK YOU. It is very much appreciated.

    Plugin Author Meitar

    (@meitar)

    ?? Thanks, Pat, that’s very kind. Donations from people like you is what makes it possible for me to continue to prioritize support queries on these forums.

    Thread Starter patsky

    (@patsky)

    Meitar – have sent you an email re this still being an issue when the sheet is contained within tabbed content. It may be a theme conflict issue but thought I would get your comments. Thanks again.

    Plugin Author Meitar

    (@meitar)

    Hi Pat,

    The problem you’re running into is an explicit incompatibility between the plugins. The ET Shortcodes plugin expressly removes line breaks in tabbed content although I’m not really sure why. Maybe it was some design choice that the developer made, but it is certainly no accident. See line 917 of the ET Shortcodes plugin’s shortcodes.php file. Here is the problematic function:

    	function et_delete_htmltags($content,$paragraph_tag=false,$br_tag=false){
    		$content = preg_replace('#^<\/p>|^<br \/>|<p>$#', '', $content);
    
    		$content = preg_replace('#<br \/>#', '', $content);
    
    		if ( $paragraph_tag ) $content = preg_replace('#<p>|</p>#', '', $content);
    
    		return trim($content);
    	}
    

    As you can see, this function purposefully and indiscriminately removes paragraph elements (<p>) and line break elements (<br>) from any content provided to the [tab] shortcode. As a result, the line breaks inserted by Inline Google Spreadsheet Viewer to respect your explicit newlines in the Google Spreadsheet are then stripped by the ET Shortcodes plugin, apparently on purpose.

    This means that the incompatibility is squarely the result of the ET Shortcodes plugin. I looked around at the nearby functions and code flow in the ET Shortcodes plugin but unfortunately could not immediately find a workaround. There is apparently no option or plugin filter hook API with which to customize this behavior, although it’s possible that it’s simply undocumented and I haven’t found it yet.

    So I’m afraid this means that to resolve the issue, you’ll have to communicate with the developer of the ET Shortcodes plugin and inform them of why this function is causing you a problem. However, at least you can begin that conversation by pointing to a specific function in their code.

    I hope this helps and, again, I’m sorry that this means there’s nothing I can do from the Inline Google Spreadsheet Viewer side of things to resolve this incompatibility for you.

    Thread Starter patsky

    (@patsky)

    Thank you again Meitar. That is very helpful. I have contacted Elegant Themes as you suggested but in the meantime have commented out the preg_replace lines since as far as I can see it’s only cosmetic changes it makes.

    Commenting them out has only affected the line breaks in the spreadsheet viewer which is what I want – seems to have had no effect on the rest of the tabbed content which is plain text.

    No need to apologise. I’m really impressed with your level of commitment to supporting your plugin.

    Anyway I shall mark this as resolved. Thanks again.

    Donate people!!!

    Thread Starter patsky

    (@patsky)

    Just to add to this – altering the code in the manner I described is not at all best practice and you are not advised to follow my lead. I am in discussion with Elegant Themes as Meitar instructed at the moment to see if there is a better way, or to get a handle on the implications of doing it – beyond remembering to reinstate it after a theme upgrade…

    If there is I will post it here.

    Thread Starter patsky

    (@patsky)

    Okay at the risk of spamming this thread – but for completeness – I have a response from Elegant Themes.

    “The function listed above simply deletes empty paragraph and br tags that wordpress adds by default if you use visual mode for text editor and can be overriden in a child theme functions file.”

    Plugin Author Meitar

    (@meitar)

    That’s not spammy at all, thanks for the additional information! ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to show cell line break’ is closed to new replies.