Viewing 13 replies - 1 through 13 (of 13 total)
  • Same here, and with the extra space it will just display the tag.

    Workaround is use <p> </p>

    Plugin Author kavingray

    (@kavingray)

    Thanks for reporting, Will fix this ASAP.

    Did this in fact get fixed? I’m still having trouble with the break tags being removed in accordion content. Using the latest version from your GitHub.

    little bump?

    I hacked a bit and found the trouble.
    Starting at line 658 (in the dev version)…

    if ( this.o.wpuiautop ) {
    $this.find('p, br')
    .not( this.o.content + ' > br, ' + this.o.content + '.wp-tab-content > p' )
    .filter(function() {
    return( $.trim( $(this).html() ) === '' );
    }).remove();
    }

    This seems to find and remove all empty paragraph tags, which is good, since there are always a few strays. But it also removes all break tags! I believe, by their nature, they are always “empty” or “=== ””, so this doesn’t seem like a correct behavior to employ.

    My solution was to only find and remove empty paragraphs…

    if ( this.o.wpuiautop ) {
    $this.find('p')
    .filter(function() {
    return( $.trim( $(this).html() ) === '' );
    }).remove();
    }

    (I also removed the “.not” clause as I couldn’t see that it actually did anything, but I may not have tested enough.)

    This has fixed my issue of break tags being removed from Accordion content.

    @jdlintz which file did you find this in?

    I tried this, altering the wp-ui.dev.js as well as adding it into the wp-ui.js file and its not working. Really difficult to figure out how to alter the displayed excerpt, I need line breaks or the content displayed in an accordion is just to smashed together to be easily read. Im on the most current versions of plugin and wp as of posting…

    @rezon8dev
    What I usually do when forced to hack someone else’s dev code, is to rename the files in such a way as to make the plugin use the version I’ve edited rather than the original. So in this case, I renamed ‘wp-ui.js’ to ‘wp-ui-orig.js’ and ‘wp-ui.dev.js’ to ‘wp-ui.js.’ This, of course, makes the dev version be the active included code and that’s where I do my edits. It means I’m using the larger code file that hasn’t been “packed,” but I’m not overly concerned with minimal loading time differentials on most of my projects. I suppose I could re-pack it if it were a concern.

    The lines in question in the latest version of the plugin are 762-768

    As a follow up…the trouble with doing things my way (renaming the js files) is that I can’t blindly auto-update to the latest version of the plugin when it is released. I have to be more intentional about downloading the plugin and checking if the fix has been made in my dev environment before updating on live sites.

    @jdlintz thanks, all was helpful!

    Hey Kavin or @jdlintz,

    With the newest version of the plugin I’m having the issue with the
    html being stripped out of the accordions again. Going back and changing the wp-ui-dev.js file to the production file and going to around line 762 in the file and altering the code so br is not in the $this.find and as shown above from @jdlintz but it is not working in this version. Please advise how to remove the trim html of br tags, I need them the content in the accordion looks terrible without line breaks…

    @rezon8dev
    A quick look this morning at the latest version (0.8.7), shows the same block of code at lines 762-768 in the dev version. Breaks are still being removed from accordion content, but hacking the code and removing the ‘br’ from the find statement seems to work like before.

    I tested on a clean WordPress install with no other plugins. Not sure what else may be causing your problem.

    I see on the Plugin Directory, it’s listed as version 0.8.8, but the comments header within the js files still say 0.8.7

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘br tags removed from content’ is closed to new replies.