Accessibility First DevRel. I focus on ensuring content created, events held and company assets are as accessible as possible, for as many people as possible.
And once you run mine through a compiler / minifier and gzip them both up you saved...39 bytes! (1569 bytes vs 1530 bytes).
Those were the numbers I was talking about anyway, I don't work in Raw bytes as they are meaningless, gzipped and minified are the numbers that matter for network performance and sometimes more raw bytes means lower gzipped bytes!
I am not going to share minified code with people if I expect them to be able to dig around in it.
To really golf this you would have to completely rewrite most of it as the regexes are about 70% of the weight. Combining them into one gigantic RegEx would be one way and using capture groups.
Have a look at the page Alex linked the engine he used for his syntax highlighter was 140 bytes!
It quadruples the size! (The total is 562 bytes gzipped, damned impressive!)
Not sure if he fixed the problem in the comments where function(a,b){b/=2;return (a+b)/b;} is highlighted as a RegEx but mine can deal with that at least.
And above all....why are you golfing this silly monstrosity! I have no intention of making a WYSIWYG code editor combination in real life as I said 🤣 it lets you do things that are so so wrong like having a <h1>function(){</h1> - it hurts, it hurts so much! 😋
Hopefully both of those will give you some ideas on how to really "golf" them, but you would almost certainly be starting from scratch to get any meaningful gains over my code.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
And once you run mine through a compiler / minifier and gzip them both up you saved...39 bytes! (1569 bytes vs 1530 bytes).
Those were the numbers I was talking about anyway, I don't work in Raw bytes as they are meaningless, gzipped and minified are the numbers that matter for network performance and sometimes more raw bytes means lower gzipped bytes!
I am not going to share minified code with people if I expect them to be able to dig around in it.
To really golf this you would have to completely rewrite most of it as the regexes are about 70% of the weight. Combining them into one gigantic RegEx would be one way and using capture groups.
Have a look at the page Alex linked the engine he used for his syntax highlighter was 140 bytes!
But yet again, once you add the RegExs back in...
It quadruples the size! (The total is 562 bytes gzipped, damned impressive!)
Not sure if he fixed the problem in the comments where
function(a,b){b/=2;return (a+b)/b;}
is highlighted as a RegEx but mine can deal with that at least.And above all....why are you golfing this silly monstrosity! I have no intention of making a WYSIWYG code editor combination in real life as I said 🤣 it lets you do things that are so so wrong like having a
<h1>function(){</h1>
- it hurts, it hurts so much! 😋Hopefully both of those will give you some ideas on how to really "golf" them, but you would almost certainly be starting from scratch to get any meaningful gains over my code.