We're hiring!
*

Testing syntax highlighting on news article

Marius Vlad avatar

Marius Vlad
June 06, 2025

Share this post:

Reading time:

asdaeqwij oqiwej qemqwe

<hello> test. </hello>


/* make tables scroll when small and more content than space */
function sizeCodeTables () {

        //console.log("do it");
 
        $('.blogpostLHS pre code table , .latestnewsPostContentArea pre code table').each(function () {
        
         //reset
        var tableWidth = 0;
        var parentPreWidth = 0;
        $(this).css('width','max-content');
    
        
        var tableWidth = $(this).width();
        var parentPreWidth = $(this).closest('code').width();
            
        var parentPreWidthRounded = Math.floor(parentPreWidth) -1;    
            
        //console.log(tableWidth);
        //console.log(parentPreWidth);
        
        if(tableWidth < parentPreWidthRounded) {
        $(this).css('width' , parentPreWidthRounded +'px');
        }
 
		
    });

}

sizeCodeTables();
$(document).ready(function() { sizeCodeTables(); });
$(window).load(function() { sizeCodeTables(); });
$(window).resize(function() { sizeCodeTables(); });

asdouh asudh uiqeh wquhe iuhd spauhd quhe qwiuhd iuahsd ;iuqwh eliuhqw 'pdij 'oqwieh 'qowuihd owquhd oqhe 'oqiwh oei'h

/* make tables scroll when small and more content than space */
function sizeCodeTables () {

        //console.log("do it");
 
        $('.blogpostLHS pre code table , .latestnewsPostContentArea pre code table').each(function () {
        
         //reset
        var tableWidth = 0;
        var parentPreWidth = 0;
        $(this).css('width','max-content');
    
        
        var tableWidth = $(this).width();
        var parentPreWidth = $(this).closest('code').width();
            
        var parentPreWidthRounded = Math.floor(parentPreWidth) -1;    
            
        //console.log(tableWidth);
        //console.log(parentPreWidth);
        
        if(tableWidth < parentPreWidthRounded) {
        $(this).css('width' , parentPreWidthRounded +'px');
        }
 
		
    });

}

sizeCodeTables();
$(document).ready(function() { sizeCodeTables(); });
$(window).load(function() { sizeCodeTables(); });
$(window).resize(function() { sizeCodeTables(); });

 

Comments (0)


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


 

Search the newsroom

Latest News & Events

Testing syntax highlighting on news article

06/06/2025

Recently (test), both Weston 14.0, and 14.0.1 (bug fix) were released. Here's at look at some of the highlights and changes for this latest…

Weston 14.0: DRM-backend, color management, and output mirroring

27/11/2024

Recently (test), both Weston 14.0, and 14.0.1 (bug fix) were released. Here's at look at some of the highlights and changes for this latest…

Kernel 6.12: Small but mighty

26/11/2024

Linux kernel 6.12 is here with real-time preemption support and an extensible scheduler class. Take a look at the contributions our kernel…

Open Since 2005 logo

Our website only uses a strictly necessary session cookie provided by our CMS system. To find out more please follow this link.

Collabora Limited © 2005-2025. All rights reserved. Privacy Notice. Sitemap.