function summarize(desc) {
	if ( desc != null ) {
		desc = String(desc).replace(/\s+/g, ' ').
					replace(/"'/g, '&quot;').
					replace(/^(<\/?p>|<br\/?>|\s)+/, '');

		const match = /([\w\W]+?\.)[^a-z0-9_$]/i.exec(desc);
		return match ? match[1] : desc;
	}
}
/* Just the first sentence (up to a full stop). Should not break on dotted variable names. */
Just the first sentence (up to a full stop). Should not break on dotted variable names.
Just the first sentence ( up to a full stop ) . Should not break on dotted variable names .
function summarize(desc) {
	if ( desc != null ) {
		desc = String(desc).replace(/\s+/g, ' ').
					replace(/"'/g, '&quot;').
					replace(/^(<\/?p>|<br\/?>|\s)+/, '');
		const match = /([\w\W]+?\.)[^a-z0-9_$]/i.exec(desc);
		return match ? match[1] : desc;
	}
}
function summarize ( desc ) { if ( desc != null ) { desc = String ( desc ) . replace ( / \s+ / g , ' ' ) . replace ( / "' / g , '&quot;' ) . replace ( / ^(<\/?p>|<br\/?>|\s)+ / , '' ) ; const match = / ([\w\W]+?\.)[^a-z0-9_$] / i . exec ( desc ) ; return match ? match [ 1 ] : desc ; } }
Just the first sentence (up to a full stop).
Just the first sentence ( up to a full stop ) .