if anyone is interested, i solved the issue by customizing the search.php and content.php files into displaying search results’ content rather than excerpt. the problem is caused by my theme (and most theme)’s default setting to display search results’ excerpt. when you change it to display content, the line breaks are normal like how it displays in the post