View Single Post
Old 06-06-2022, 05:49 PM  
dcortez
DINO CORTEZ™
 
dcortez's Avatar
 
Industry Role:
Join Date: Jun 2003
Location: Vancouver Island
Posts: 2,145
Max line length in JavaScript/HTML?

The answer to this may seem obvious, but I cannot find any online limit that is compatible with Minification/Obfuscation...

Consider the following:

SCRIPT
var A = 'aaaaaaaaaa';
var B = 'bbbbbbbbbb';
var C = 'cccccccccccc';
...
var Z = 'zzzzzzzzzzzz';
/SCRIPT

I would like to compact that to:

SCRIPT
var A = 'aaaaaaaaaa'; var B = 'bbbbbbbbbb'; var C = 'cccccccccccc'; ... var Z = 'zzzzzzzzzzzz';
/SCRIPT

The 'how' is easy, but I am concerned about breaking limits for text blob lengths in HTML, between SCRIPT tags.

ie. A real life text blob could be 16k chars or more.

All references to HTML and JS max line lengths seem to suggest 100 chars - for HTML that has to do with fitting lines within HTTP transfer blocks, and for JS, it's only for readability (which is not applicable here).

??
dcortez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote