class Haml::StringSplitter

def escape_quotes(beg_str, end_str)

Some quotes are split-unsafe. Replace such quotes with null characters.
def escape_quotes(beg_str, end_str)
  case [beg_str[-1], end_str]
  when ['(', ')'], ['[', ']'], ['{', '}']
    [beg_str.sub(/.\z/) { "\0" }, "\0"]
  else
    [beg_str, end_str]
  end
end