nl_tokens: Removing ruleset nodes from tree may result in two adjacent whitespace nodes which is not correct AST : [ space ruleset space ] = > [ space space ] To ensure correctness of further processing we should merge such nodes into one : [ space space ] = > [ space ]
pl_tokens: function mergeAdjacentWhitespace ( node ) { var i = node . content . length - 1 ; while ( i -- > 0 ) { if ( <mask> . get ( i ) . is ( 'space' ) && node . get ( i + 1 ) && node . get ( i + 1 ) . is ( 'space' ) ) { node . get ( i ) . content += node . get ( i + 1 ) . content ; node . removeChild ( i + 1 ) ; } } }