diff options
Diffstat (limited to 'xml/xml-psi-impl/src/com/intellij/psi/impl/source/resolve/reference')
2 files changed, 5 insertions, 1 deletions
diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlAttributeValueManipulator.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlAttributeValueManipulator.java index a32b51f5fc3f..92c287e8fdbe 100644 --- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlAttributeValueManipulator.java +++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlAttributeValueManipulator.java @@ -30,6 +30,7 @@ import com.intellij.psi.xml.XmlAttributeValue; import com.intellij.psi.xml.XmlTokenType; import com.intellij.util.CharTable; import com.intellij.util.IncorrectOperationException; +import com.intellij.xml.util.XmlUtil; import org.jetbrains.annotations.NotNull; /** @@ -63,7 +64,7 @@ public class XmlAttributeValueManipulator extends AbstractElementManipulator<Xml final int offsetInParent = elementToReplace.getStartOffsetInParent(); String textBeforeRange = text.substring(0, range.getStartOffset() - offsetInParent); String textAfterRange = text.substring(range.getEndOffset()- offsetInParent, text.length()); - text = textBeforeRange + newContent + textAfterRange; + text = textBeforeRange + XmlUtil.escape(newContent) + textAfterRange; } catch(StringIndexOutOfBoundsException e) { LOG.error("Range: " + range + " in text: '" + element.getText() + "'", e); throw e; diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTextManipulator.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTextManipulator.java index de4f9eb6cbc7..e160ba4c14db 100644 --- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTextManipulator.java +++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTextManipulator.java @@ -51,6 +51,9 @@ public class XmlTextManipulator extends AbstractElementManipulator<XmlText> { else { text.deleteChildRange(text.getFirstChild(), text.getLastChild()); } + //String oldText = text.getText(); + //((PsiLanguageInjectionHost)text).updateText( + // oldText.substring(0, range.getStartOffset()) + newContent + oldText.substring(range.getEndOffset())); return text; } |