summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx22
1 files changed, 14 insertions, 8 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 244c1eab0..a5d1e8895 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -28,6 +28,9 @@ module.exports.isTestDomain = function() {
if ((/^localhost/).test(window.location.hostname))
return true;
+ if ((/^dockerhost/).test(window.location.hostname))
+ return true;
+
if ((/^test/).test(window.location.hostname))
return true;
@@ -75,8 +78,14 @@ module.exports.getDomainWithOutSub = function() {
var parts = window.location.host.split(".");
- if (parts.length == 1)
- return "localhost:8065";
+ if (parts.length == 1) {
+ if (parts[0].indexOf("dockerhost") > -1) {
+ return "dockerhost:8065";
+ }
+ else {
+ return "localhost:8065";
+ }
+ }
return parts[1] + "." + parts[2];
}
@@ -357,9 +366,6 @@ module.exports.textToJsx = function(text, options) {
if (options && options['singleline']) {
var repRegex = new RegExp("\n", "g");
text = text.replace(repRegex, " ");
- } else {
- var repRegex = new RegExp("\n", "g");
- text = text.replace(repRegex, "<br>");
}
var searchTerm = ""
@@ -383,7 +389,7 @@ module.exports.textToJsx = function(text, options) {
implicitKeywords[keywordArray[i]] = true;
}
- var lines = text.split("<br>");
+ var lines = text.split("\n");
var urlMatcher = new LinkifyIt();
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
@@ -425,7 +431,7 @@ module.exports.textToJsx = function(text, options) {
} else if (trimWord.match(hashRegex)) {
var suffix = word.match(puncEndRegex);
var prefix = word.match(puncStartRegex);
- var mClass = trimWord in implicitKeywords ? mentionClass : "";
+ var mClass = trimWord in implicitKeywords || trimWord.toLowerCase() in implicitKeywords ? mentionClass : "";
if (searchTerm === trimWord.substring(1).toLowerCase() || searchTerm === trimWord.toLowerCase()) {
highlightSearchClass = " search-highlight";
@@ -433,7 +439,7 @@ module.exports.textToJsx = function(text, options) {
inner.push(<span key={word+i+z+"_span"}>{prefix}<a key={word+i+z+"_hash"} className={"theme " + mClass + highlightSearchClass} href="#" onClick={function(value) { return function() { module.exports.searchForTerm(value); } }(trimWord)}>{trimWord}</a>{suffix} </span>);
- } else if (trimWord in implicitKeywords) {
+ } else if (trimWord in implicitKeywords || trimWord.toLowerCase() in implicitKeywords) {
var suffix = word.match(puncEndRegex);
var prefix = word.match(puncStartRegex);