Verified Commit 39e6932a authored by Camil Staps's avatar Camil Staps 🚀

Concatenate spans with the same class

parent 461b1b30
......@@ -25,6 +25,9 @@ function highlight(lex, istr, start) {
var j = 0;
for (var k in clss) {
j++;
if (out.length > 0 && out[out.length-1]['class'] == clss[k])
out[out.length-1]['str'] += parts[j];
else
out.push({'class': clss[k], 'str': parts[j]});
}
istr = parts[j+1];
......
......@@ -122,6 +122,7 @@ fs.readdir('tests', function(err, files) {
htmlResults = '<!DOCTYPE html>\
<html>\
<head>\
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\
<link rel="stylesheet" href="clean.css" type="text/css"/>\
<link rel="stylesheet" href="test_results.css" type="text/css"/>\
<title>clean.js test results</title>\
......
......@@ -30,8 +30,7 @@ whitespace
typevar s
whitespace
keyword where
whitespace \n
whitespace \n
whitespace \n\n
funcname textSize
whitespace
punctuation ::
......@@ -39,27 +38,22 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
type Int
whitespace \n
whitespace
funcname concat
whitespace
punctuation ::
whitespace
punctuation !
punctuation [
punctuation ![
typevar s
punctuation ]
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname split
whitespace
punctuation ::
......@@ -70,14 +64,12 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation [
typevar s
punctuation ]
whitespace \n
whitespace
funcname join
whitespace
punctuation ::
......@@ -85,17 +77,14 @@ whitespace
punctuation !
typevar s
whitespace
punctuation !
punctuation [
punctuation ![
typevar s
punctuation ]
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname indexOf
whitespace
punctuation ::
......@@ -106,12 +95,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
type Int
whitespace \n
whitespace
funcname lastIndexOf
whitespace
punctuation ::
......@@ -122,12 +109,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
type Int
whitespace \n
whitespace
funcname indexOfAfter
whitespace
punctuation ::
......@@ -141,12 +126,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
type Int
whitespace \n
whitespace
funcname startsWith
whitespace
punctuation ::
......@@ -157,12 +140,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
type Bool
whitespace \n
whitespace
funcname endsWith
whitespace
punctuation ::
......@@ -173,12 +154,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
type Bool
whitespace \n
whitespace
funcname subString
whitespace
punctuation ::
......@@ -192,12 +171,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname replaceSubString
whitespace
punctuation ::
......@@ -211,12 +188,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname trim
whitespace
punctuation ::
......@@ -224,12 +199,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname ltrim
whitespace
punctuation ::
......@@ -237,12 +210,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname rtrim
whitespace
punctuation ::
......@@ -250,12 +221,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname lpad
whitespace
punctuation ::
......@@ -269,12 +238,10 @@ whitespace
punctuation !
type Char
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname rpad
whitespace
punctuation ::
......@@ -288,12 +255,10 @@ whitespace
punctuation !
type Char
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname toLowerCase
whitespace
punctuation ::
......@@ -301,12 +266,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname toUpperCase
whitespace
punctuation ::
......@@ -314,12 +277,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname upperCaseFirst
whitespace
punctuation ::
......@@ -327,12 +288,10 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
whitespace \n
whitespace
funcname dropChars
whitespace
punctuation ::
......@@ -343,7 +302,6 @@ whitespace
punctuation !
typevar s
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar s
......@@ -11,28 +11,22 @@ whitespace
punctuation |
whitespace
generic gEditor
punctuation {|
punctuation *|},
punctuation {|*|},
whitespace
generic gText
punctuation {|
punctuation *|},
punctuation {|*|},
whitespace
generic JSONEncode
punctuation {|
punctuation *|},
punctuation {|*|},
whitespace
generic JSONDecode
punctuation {|
punctuation *|},
punctuation {|*|},
whitespace
generic gDefault
punctuation {|
punctuation *|},
punctuation {|*|},
whitespace
generic gEq
punctuation {|
punctuation *|},
punctuation {|*|},
whitespace
classname TC
whitespace
......
......@@ -12,7 +12,6 @@ punctuation ::
whitespace
typevar a
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
type Int
......@@ -14,28 +14,22 @@ punctuation ]
whitespace
punctuation (
existential A
punctuation .
punctuation *
punctuation .*
typevar cur
punctuation :
whitespace
punctuation (
punctuation *
punctuation (*
typevar cur
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *(
type MaybeErrorString
whitespace
typevar a
punctuation ,
punctuation *
punctuation ,*
typevar cur
punctuation )
punctuation )
punctuation ))
whitespace
punctuation |
whitespace
......
......@@ -10,33 +10,27 @@ type String
whitespace
punctuation (
existential A
punctuation .
punctuation *
punctuation .*
typevar cur
punctuation :
whitespace
punctuation (
typevar p
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
typevar cur
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *(
type MaybeErrorString
whitespace
typevar r
punctuation ,
punctuation *
punctuation ,*
typevar cur
punctuation )
punctuation )
punctuation ))
whitespace
punctuation |
whitespace
......@@ -47,38 +41,31 @@ punctuation )
whitespace
punctuation (
existential A
punctuation .
punctuation *
punctuation .*
typevar cur
punctuation :
whitespace
punctuation (
typevar p
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar w
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
typevar cur
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *(
type MaybeErrorString
whitespace
type ()
punctuation ,
punctuation *
punctuation ,*
typevar cur
punctuation )
punctuation )
punctuation ))
whitespace
punctuation |
whitespace
......
......@@ -13,13 +13,11 @@ whitespace
punctuation (
typevar a
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar b
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar a
punctuation )
......@@ -30,8 +28,7 @@ punctuation [
typevar b
punctuation ]
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar a
whitespace \n
......@@ -63,7 +60,6 @@ punctuation =
whitespace
macroargumentinrhs r
whitespace \n
whitespace
funcname foldl
whitespace
macroargument r
......
......@@ -402,17 +402,14 @@ whitespace
punctuation (
typevar p
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
type IWorld
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *(
type MaybeError
whitespace
type TaskException
......@@ -425,10 +422,8 @@ whitespace
typevar r
whitespace
typevar w
punctuation )
punctuation ,
punctuation ),
whitespace
punctuation *
type IWorld
punctuation )
punctuation )
punctuation ))
......@@ -68,20 +68,14 @@ punctuation ::
whitespace
typevar st
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *
punctuation *(*
type World
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *
punctuation *(*
type HandlerResponse
whitespace
typevar ci
......@@ -91,8 +85,7 @@ punctuation ,
whitespace
punctuation *
type World
punctuation )
punctuation )
punctuation ))
whitespace
comment //* Runs initially
whitespace \n
......@@ -104,29 +97,22 @@ punctuation ::
whitespace
type String
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
type Int
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar st
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *
punctuation *(*
type World
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *(
type Maybe
whitespace
type String
......@@ -145,8 +131,7 @@ punctuation ,
whitespace
punctuation *
type World
punctuation )
punctuation )
punctuation ))
whitespace
comment //* Runs when a client connects to one of your listeners
whitespace \n
......@@ -158,24 +143,18 @@ punctuation ::
whitespace
typevar ci
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar st
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *
punctuation *(*
type World
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *(
type Maybe
whitespace
type String
......@@ -194,8 +173,7 @@ punctuation ,
whitespace
punctuation *
type World
punctuation )
punctuation )
punctuation ))
whitespace
comment //* Runs when a new connection was set up successfully
whitespace \n
......@@ -207,29 +185,22 @@ punctuation ::
whitespace
type String
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar ci
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
typevar st
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *
punctuation *(*
type World
whitespace
punctuation -
punctuation >
punctuation ->
whitespace
punctuation *
punctuation (
punctuation *(
type Maybe
whitespace
type String
......@@ -248,8 +219,7 @@ punctuation ,
whitespace
punctuation *
type World
punctuation )
punctuation )
punctuation ))
whitespace
comment //* Runs when there is data on one of the channels
whitespace \n
......@@ -261,20 +231,14 @@ punctuation ::
whitespace
typevar st
whitespace
punctuation -
punctuation >