html/rainbow/rainbow.js
function _matchIsInsideOtherMatch(start, end) {
        for (var key in replacement_positions[CURRENT_LEVEL]) {
            key = parseInt(key, 10);

            // if this block completely overlaps with another block
            // then we should remove the other block and return false
            if (_hasCompleteOverlap(key, replacement_positions[CURRENT_LEVEL][key], start, end)) {
                delete replacement_positions[CURRENT_LEVEL][key];
                delete replacements[CURRENT_LEVEL][key];
            }

            if (_intersects(key, replacement_positions[CURRENT_LEVEL][key], start, end)) {
                return true;
            }
        }

        return false;
    }
function _matchIsInsideOtherMatch(start, end) {
        for (var key in replacement_positions[CURRENT_LEVEL]) {
            key = parseInt(key, 10);

            // if this block completely overlaps with another block
            // then we should remove the other block and return false
            if (_hasCompleteOverlap(key, replacement_positions[CURRENT_LEVEL][key], start, end)) {
                delete replacement_positions[CURRENT_LEVEL][key];
                delete replacements[CURRENT_LEVEL][key];
            }

            if (_intersects(key, replacement_positions[CURRENT_LEVEL][key], start, end)) {
                return true;
            }
        }

        return false;
    }
function _matchIsInsideOtherMatch ( start , end ) { for ( var key in replacement_positions [ CURRENT_LEVEL ] ) { key = parseInt ( key , 10 ) ; // if this block completely overlaps with another block // then we should remove the other block and return false if ( _hasCompleteOverlap ( key , replacement_positions [ CURRENT_LEVEL ] [ key ] , start , end ) ) { delete replacement_positions [ CURRENT_LEVEL ] [ key ] ; delete replacements [ CURRENT_LEVEL ] [ key ] ; } if ( _intersects ( key , replacement_positions [ CURRENT_LEVEL ] [ key ] , start , end ) ) { return true ; } } return false ; }
determines if the match passed in falls inside of an existing match
this prevents a regex pattern from matching inside of a bigger pattern

@param {number} start - start position of new match
@param {number} end - end position of new match
@returns {boolean}
determines if the match passed in falls inside of an existing match this prevents a regex pattern from matching inside of a bigger pattern