projects
/
idea
/
community.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
510dfb9
)
RUBY-16568 Spell check does not work outside of HTML tags
author
Andrey Vokin
<andrey.vokin@jetbrains.com>
Fri, 10 Apr 2015 16:17:47 +0000
(19:17 +0300)
committer
Andrey Vokin
<andrey.vokin@jetbrains.com>
Wed, 15 Apr 2015 09:53:10 +0000
(12:53 +0300)
spellchecker/src/com/intellij/spellchecker/tokenizer/SpellcheckingStrategy.java
patch
|
blob
|
history
spellchecker/testData/inspection/xmlWithMistakes/test.html
[new file with mode: 0644]
patch
|
blob
spellchecker/testSrc/com/intellij/spellchecker/inspection/XmlWithMistakesInspectionTest.java
patch
|
blob
|
history
diff --git
a/spellchecker/src/com/intellij/spellchecker/tokenizer/SpellcheckingStrategy.java
b/spellchecker/src/com/intellij/spellchecker/tokenizer/SpellcheckingStrategy.java
index ccdc1199f5342018584a3c9d1caf08b36f3821f8..fa88295a75cd7fc5d2ea0d66f73e5dd724fb4518 100644
(file)
--- a/
spellchecker/src/com/intellij/spellchecker/tokenizer/SpellcheckingStrategy.java
+++ b/
spellchecker/src/com/intellij/spellchecker/tokenizer/SpellcheckingStrategy.java
@@
-25,6
+25,8
@@
import com.intellij.psi.*;
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
import com.intellij.psi.xml.XmlAttributeValue;
import com.intellij.psi.xml.XmlText;
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
import com.intellij.psi.xml.XmlAttributeValue;
import com.intellij.psi.xml.XmlText;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
import com.intellij.spellchecker.inspections.PlainTextSplitter;
import com.intellij.spellchecker.inspections.TextSplitter;
import com.intellij.spellchecker.quickfixes.AcceptWordAsCorrect;
import com.intellij.spellchecker.inspections.PlainTextSplitter;
import com.intellij.spellchecker.inspections.TextSplitter;
import com.intellij.spellchecker.quickfixes.AcceptWordAsCorrect;
@@
-71,6
+73,9
@@
public class SpellcheckingStrategy {
}
return TEXT_TOKENIZER;
}
}
return TEXT_TOKENIZER;
}
+ if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_DATA_CHARACTERS) {
+ return TEXT_TOKENIZER;
+ }
return EMPTY_TOKENIZER;
}
return EMPTY_TOKENIZER;
}
diff --git a/spellchecker/testData/inspection/xmlWithMistakes/test.html
b/spellchecker/testData/inspection/xmlWithMistakes/test.html
new file mode 100644
(file)
index 0000000..
4670964
--- /dev/null
+++ b/
spellchecker/testData/inspection/xmlWithMistakes/test.html
@@ -0,0
+1,3
@@
+<a>test</a>
+<TYPO descr="Typo: In word 'ttest'">ttest</TYPO>
+<div>test</div>
\ No newline at end of file
diff --git
a/spellchecker/testSrc/com/intellij/spellchecker/inspection/XmlWithMistakesInspectionTest.java
b/spellchecker/testSrc/com/intellij/spellchecker/inspection/XmlWithMistakesInspectionTest.java
index a212cda9aad278177dcc1d6d3ccb5e4f01378afc..18f039b21533ebd8392534ce7cca8264f20fa0a0 100644
(file)
--- a/
spellchecker/testSrc/com/intellij/spellchecker/inspection/XmlWithMistakesInspectionTest.java
+++ b/
spellchecker/testSrc/com/intellij/spellchecker/inspection/XmlWithMistakesInspectionTest.java
@@
-27,4
+27,8
@@
public class XmlWithMistakesInspectionTest extends SpellcheckerInspectionTestCas
public void testXml() {
doTest("test.xml");
}
public void testXml() {
doTest("test.xml");
}
+
+ public void testCharacterData() {
+ doTest("test.html");
+ }
}
}