Skip to content

Commit 25912be

Browse files
author
Denys Zaiats
committed
[master] - added fix for language verification
1 parent 6ad31cb commit 25912be

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/util/validator/LanguageChecker.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public static boolean isCorrectLanguageOnThePage(WebDriver driver, String lang)
3737
boolean isCorrectLang = true;
3838
JavascriptExecutor jse = (JavascriptExecutor) driver;
3939
String bodyText = jse.executeScript("return document.body.innerHTML", "").toString();
40-
bodyText = bodyText.replaceAll("<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>", "");
41-
bodyText = bodyText.replaceAll("<noscript\\b[^<]*(?:(?!<\\/noscript>)<[^<]*)*<\\/noscript>", "");
42-
bodyText = bodyText.replaceAll("<style\\b[^<]*(?:(?!<\\/style>)<[^<]*)*<\\/style>", "");
43-
bodyText = bodyText.replaceAll("<pre\\b[^<]*(?:(?!<\\/pre>)<[^<]*)*<\\/pre>", "");
44-
bodyText = bodyText.replaceAll("<[^>]*>", "");
40+
bodyText = bodyText.replaceAll("<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>", " ");
41+
bodyText = bodyText.replaceAll("<noscript\\b[^<]*(?:(?!<\\/noscript>)<[^<]*)*<\\/noscript>", " ");
42+
bodyText = bodyText.replaceAll("<style\\b[^<]*(?:(?!<\\/style>)<[^<]*)*<\\/style>", " ");
43+
bodyText = bodyText.replaceAll("<pre\\b[^<]*(?:(?!<\\/pre>)<[^<]*)*<\\/pre>", " ");
44+
bodyText = bodyText.replaceAll("<[^>]*>", " ");
4545
bodyText = bodyText.toLowerCase().replaceAll("[\\t|\\n|\\r|\\s]+", " ").replaceAll("[\\s]+", " ");
4646

4747
int textBlockLength = 300;

0 commit comments

Comments
 (0)