textgen: fix score calculation for multi-line text