'Performs the disable pragma search and marks the rule as disabled if a
matching pragma is found.
Pragma format::
xss-lint: disable=violation-name,other-violation-name
Arguments:
string: The string of code in which to search for the pragma.
scope_start_string: True if the pragma must be at the start of the
string, False otherwise. The pragma is considered at the start
of the string if it has a maximum of 5 non-whitespace characters
preceding it.
Side Effect:
Sets self.is_disabled as appropriate based on whether the pragma is
found.'

def _mark_disabled(self, string, scope_start_string=False):

    pragma_match = re.search('xss-lint:\\s*disable=([a-zA-Z,-]+)', string)
    if (pragma_match is None):
        return
    if scope_start_string:
        spaces_count = string.count('    ', 0, pragma_match.start())
        non_space_count = (pragma_match.start() - spaces_count)
        if (non_space_count > 5):
            return
    for disabled_rule in pragma_match.group(1).split(','):
        if (disabled_rule == self.rule.rule_id):
            self.is_disabled = True
            return
