Results 1 to 11 of 11

'Cleanup HTML Code' feature removes </pre> from bbcode_code template

This is a discussion on 'Cleanup HTML Code' feature removes </pre> from bbcode_code template within the Bug Reporting forums, part of the vBSEO SEO Plugin category; When I enable the ' Cleanup HTML Code ' feature in vBSEO (I use the current version), about 30 pages ...

  1. #1
    Senior Member
    Real Name
    Marvin Hlavac
    Join Date
    Oct 2007
    Posts
    254
    Liked
    15 times

    'Cleanup HTML Code' feature removes </pre> from bbcode_code template

    When I enable the 'Cleanup HTML Code' feature in vBSEO (I use the current version), about 30 pages on my forum no longer validate. In all of these pages a poster used the 'Code' bbcode. W3 validator points at a missing </pre> tag.

    When I disable the 'Cleanup HTML Code' feature, I can see the </pre> tag present in my source.

    I never used the 'Cleanup HTML Code' feature before, so I do not know if this is a new issue in the latest vbSEO version.

    Please advise. I'm leaving the 'Cleanup HTML Code' feature disabled in the meantime.

    Thanks.

  2. #2
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,100
    Liked
    622 times
    Blog Entries
    4
    Hello ,

    vBSEO clean up feature only removes white spaces and comments within your pages. Enabling it or disabling should not effect page validation at all.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  3. #3
    Senior Member
    Real Name
    Marvin Hlavac
    Join Date
    Oct 2007
    Posts
    254
    Liked
    15 times
    Hi Mert,

    Yes, I understand the feature is supposed to remove only empty lines and comments. That's the reason I posted it here to the bug section.

    I just tested it the second time, but I'm getting the same results. :(

    My entire site validates with no markup errors when the 'HTML Cleanup' feature is not used. But when I enable the feature, all pages that contain the code bbcode, no longer pass the w3 validation.

    Here's a sample snippet of source code from one of such pages.

    'HTML Cleanup' OFF

    Code:
            <!-- message -->
            <div id="post_message_663">
                
                Marvin<br />
     <br />
    I tried adding this code to let the Scanner detect which S&amp;T is running between 2008 and 2006-2007. It didn't work. Can you suggest an alteration to the code? I have two S&amp;T installed on my computer and would like the POI to be the same for 2006 to 2008. It would be nice to have to avoid using two versions. <br />
     <br />
     <br />
    <div style="margin:20px; margin-top:5px">
        <div class="smallfont" style="margin-bottom:2px">Code:</div>
        <pre class="alt2" dir="ltr" style="
            margin: 0px;
            padding: 6px;
            border: 1px inset;
            width: 640px;
            height: 114px;
            text-align: left;
            overflow: auto">If WinExists(&quot;AfxWnd802&quot;) Then
        $pos_AfxWnd802 = ControlGetPos($productname, &quot;&quot;, &quot;AfxWnd802&quot;)
    EndIf    
    If WinExists(&quot;AfxWnd702&quot;) Then    
        $pos_AfxWnd802 = ControlGetPos($productname, &quot;&quot;, &quot;AfxWnd702&quot;)
    EndIf</pre>
    </div>
            </div>
            <!-- / message -->
    'HTML Cleanup' ON

    Code:
    <div id="post_message_663">
                
                Marvin<br /> <br />
    I tried adding this code to let the Scanner detect which S&amp;T is running between 2008 and 2006-2007. It didn't work. Can you suggest an alteration to the code? I have two S&amp;T installed on my computer and would like the POI to be the same for 2006 to 2008. It would be nice to have to avoid using two versions. <br /> <br /> <br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <pre class="alt2" dir="ltr" style="
            margin: 0px;
            padding: 6px;
            border: 1px inset;
            width: 640px;
            height: 114px;
            text-align: left;
            overflow: auto">If WinExists(&quot;AfxWnd802&quot;) Then
        $pos_AfxWnd802 = ControlGetPos($productname, &quot;&quot;, &quot;AfxWnd802&quot;)
    EndIf    
    If WinExists(&quot;AfxWnd702&quot;) Then    
        $pos_AfxWnd802 = ControlGetPos($productname, &quot;&quot;, &quot;AfxWnd702&quot;)
    EndIf
    </div> </div>
    W3 Validator reports: end tag for "pre" omitted, but OMITTAG NO was specified

  4. #4
    Senior Member
    Real Name
    Marvin Hlavac
    Join Date
    Oct 2007
    Posts
    254
    Liked
    15 times
    Quote Originally Posted by Mert Gökçeimam View Post

    vBSEO clean up feature only removes white spaces
    The <pre> element preserves white spaces. I'm thinking there may be some relationship there.

    P.S. The issue is also present here on vbseo.com: W3 Validation of this page - try to disable html cleanup, and the markup errors related to the <pre> element should go away.

  5. #5
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    similar thread:
    optimize html text - problem mediawiki - preformatted text

    looks like there may be an issue with the preg replace.

  6. #6
    Senior Member
    Real Name
    Marvin Hlavac
    Join Date
    Oct 2007
    Posts
    254
    Liked
    15 times
    Brian, thanks for looking into it. Yes, that touches the same issue. It may be worth looking into it deeper, as vbseo.com forum is affected by it, too: W3 Validation of this page - try to disable the html cleanup, and the markup errors related to the <pre> element should go away.

    The HTML Cleanup feature removes the </pre> closing tag for some reason. As a temporary work-around I added a second </pre> closing tag to bbcode_code template, as shown in the code bellow.

    Code:
    overflow: auto">$code</pre></pre>
    One of the two </pre> closing tags is removed by the HTML Cleanup feature, but the other one is not removed. Now my pages pass the W3 HTML validation when HTML Cleanup is enabled.

    P.S. I just ran an automated scan of my entire site (after this 'work-around'). All markup errors are gone.

  7. #7
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times
    Hello,

    please try to modify functions_vbseo.php file:
    find:
    Code:
    array(  '#(<pre[^>]*?>)(.*?)</pre>#sie',
    replace with:
    Code:
    array(  '#(<pre[^>]*?>)(.*?)(</pre>)#sie',

  8. #8
    Senior Member
    Real Name
    Marvin Hlavac
    Join Date
    Oct 2007
    Posts
    254
    Liked
    15 times
    Hi Oleg,

    That did it. Thanks so very much!

    I modified the functions_vbseo.php file, then I removed my temporary work-around by reverting the bbcode-code template, and now I do see the </pre> closing tag in my source code, and the affected pages do pass the W3 HTML Validator. I scanned my entire site for html markup errors, and none were found.

    I double checked that the HTML Cleanup feature was enabled. It was.

    I'm a happy camper now!


  9. #9
    Senior Member
    Real Name
    Admin
    Join Date
    Nov 2006
    Posts
    247
    Liked
    0 times
    will functions_vbseo.php be corrected like this in the next update, too?

  10. #10
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    Yes, this fix wills ship with our next release.

  11. #11
    Senior Member
    Real Name
    Adam
    Join Date
    Oct 2006
    Location
    AZ
    Posts
    109
    Liked
    0 times
    As far as I can see, the last replacement should also be

    '<br />',

    instead of

    "\n",

    Since the intended effect is to restore line breaks in code/html/php tags

Similar Threads

  1. Cleanup HTML code
    By MikeWarner in forum General Discussion
    Replies: 6
    Last Post: 03-05-2009, 10:16 AM
  2. ÇíÔ ãÚäì ÎíÇÑ Cleanup HTML Code
    By saleh15 in forum العربية
    Replies: 5
    Last Post: 11-07-2008, 12:17 PM
  3. Cleanup HTML code NON forum
    By rocket468 in forum General Discussion
    Replies: 0
    Last Post: 07-05-2007, 02:09 PM
  4. Cleanup HTML Code
    By Toddy38 in forum Deutsch
    Replies: 2
    Last Post: 02-19-2006, 08:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •