'Finds the string wrapping the Mako expression if there is one.
Arguments:
mako_template: The contents of the Mako template.
expression: A Mako Expression.
Returns:
ParseString representing a scrubbed version of the wrapped string,
where the Mako expression was replaced with "${...}", if a wrapped
string was found.  Otherwise, returns None if none found.'

def _find_string_wrapping_expression(self, mako_template, expression):

    lines = StringLines(mako_template)
    start_index = lines.index_to_line_start_index(expression.start_index)
    if (expression.end_index is not None):
        end_index = lines.index_to_line_end_index(expression.end_index)
    else:
        return None
    scrubbed_lines = ''.join((mako_template[start_index:expression.start_index], '${...}', mako_template[expression.end_index:end_index]))
    adjusted_start_index = (expression.start_index - start_index)
    start_index = 0
    while True:
        parse_string = ParseString(scrubbed_lines, start_index, len(scrubbed_lines))
        if (0 <= parse_string.start_index < parse_string.end_index):
            if (parse_string.start_index < adjusted_start_index < parse_string.end_index):
                return parse_string
            else:
                start_index = parse_string.end_index
        else:
            break
    return None
