Modified fnPrepareSortElement to handle newline characters.