Set text to empty string when null is passed as argument (#5560)
This commit is contained in:
parent
c48761c628
commit
e3de396091
|
@ -2,11 +2,12 @@ import { registerUnbound } from "discourse-common/lib/helpers";
|
||||||
import { isRTL } from 'discourse/lib/text-direction';
|
import { isRTL } from 'discourse/lib/text-direction';
|
||||||
|
|
||||||
function setDir(text) {
|
function setDir(text) {
|
||||||
if (Discourse.SiteSettings.support_mixed_text_direction) {
|
let content = text ? text : "";
|
||||||
let textDir = isRTL(text) ? 'rtl' : 'ltr';
|
if (content && Discourse.SiteSettings.support_mixed_text_direction) {
|
||||||
return `<span dir="${textDir}">${text}</span>`;
|
let textDir = isRTL(content) ? 'rtl' : 'ltr';
|
||||||
|
return `<span dir="${textDir}">${content}</span>`;
|
||||||
}
|
}
|
||||||
return text;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default registerUnbound('dir-span', function(str) {
|
export default registerUnbound('dir-span', function(str) {
|
||||||
|
|
Loading…
Reference in New Issue