FIXED!!!!
When I did both of happygiraffe’s edits, the plugin didn’t work. As it turned out, all I needed to do was happygiraffe’s second edit:
change line 153 from if (eml != ”) { to if (eml) {
His edit for line 158 probably works on some operating systems but not others. To make the plugin OS-independent, I think the code should replace line 158 with these two lines:
str_replace(“\r”, ” “, $previewFormat);
str_replace(“\n”, ” “, $previewFormat);
This will replace each possible return character separately. Also, note that instead of replacing the characters with the empty string, they’re replaced by a space. This is in case $previewFormat has two English words separated across two lines — it would be add for the str_replace to concatenate them.