client/js/libs/handlebars/parse.js
// Create an HTML `span` with styling information for a given fragment
Create an HTML `span` with styling information for a given fragment
Create an HTML ` span ` with styling information for a given fragment
function createFragment(fragment) {
	let classes = [];
	if (fragment.bold) {
		classes.push("irc-bold");
	}
	if (fragment.textColor !== undefined) {
		classes.push("irc-fg" + fragment.textColor);
	}
	if (fragment.bgColor !== undefined) {
		classes.push("irc-bg" + fragment.bgColor);
	}
	if (fragment.italic) {
		classes.push("irc-italic");
	}
	if (fragment.underline) {
		classes.push("irc-underline");
	}
	const escapedText = Handlebars.Utils.escapeExpression(fragment.text);
	if (classes.length) {
		return `<span class="${classes.join(" ")}">${escapedText}</span>`;
	}
	return escapedText;
}
function createFragment ( fragment ) { let classes = [ ] ; if ( fragment . bold ) { classes . push ( "irc-bold" ) ; } if ( fragment . textColor !== undefined ) { classes . push ( "irc-fg" + fragment . textColor ) ; } if ( fragment . bgColor !== undefined ) { classes . push ( "irc-bg" + fragment . bgColor ) ; } if ( fragment . italic ) { classes . push ( "irc-italic" ) ; } if ( fragment . underline ) { classes . push ( "irc-underline" ) ; } const escapedText = Handlebars . Utils . escapeExpression ( fragment . text ) ; if ( classes . length ) { return ` ${ classes . join ( " " ) } ${ escapedText } ` ; } return escapedText ; }
Create an HTML `span` with styling information for a given fragment
Create an HTML ` span ` with styling information for a given fragment