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';
|
||||
|
||||
function setDir(text) {
|
||||
if (Discourse.SiteSettings.support_mixed_text_direction) {
|
||||
let textDir = isRTL(text) ? 'rtl' : 'ltr';
|
||||
return `<span dir="${textDir}">${text}</span>`;
|
||||
let content = text ? text : "";
|
||||
if (content && Discourse.SiteSettings.support_mixed_text_direction) {
|
||||
let textDir = isRTL(content) ? 'rtl' : 'ltr';
|
||||
return `<span dir="${textDir}">${content}</span>`;
|
||||
}
|
||||
return text;
|
||||
return content;
|
||||
}
|
||||
|
||||
export default registerUnbound('dir-span', function(str) {
|
||||
|
|
Loading…
Reference in New Issue