Besides the obvious solution of deleting the empty lines from the text document you could also check in your code, if the line you are currently handling contains any text.
foreach (var keyword in keywords) {
if (string.IsNullOrWhitespace(keyword))
continue;
...
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…