void (@NotNull XmlAttributeValue value) { //use original range to check because while we are modifying document, element ranges returned from getTextRange() are not updated. if (myOriginalRange.contains(value.getTextRange())) { PsiElement child = value.getFirstChild(); if (child != null && !containsQuoteChars(value) // For now, we skip values containing quotes to be inserted/replaced ) { if (child.getNode().getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER) { PsiElement lastChild = value.getLastChild(); if (lastChild != null && lastChild.getNode().getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER) { CharSequence delimiterChars = child.getNode().getChars(); if (delimiterChars.length() == 1 && !StringUtil.equals(delimiterChars, myNewQuote)) { int startOffset = value.getTextRange().getStartOffset(); int endOffset = value.getTextRange().getEndOffset(); replaceString(startOffset, startOffset + 1, myNewQuote); replaceString(endOffset - 1, endOffset, myNewQuote); } } } else if (child.getNode().getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN && child == value.getLastChild()) { insertString(child.getTextRange().getStartOffset(), myNewQuote); insertString(child.getTextRange().getEndOffset(), myNewQuote); } } } }