I am writing a shortcode which accepts text and prints in a certain format on the page e.g. changing text color for any text between chosen magic chars say #…# .
My shortcode works and looks great. But the problem is when I pass the text to the shortcode, it all wraps into one single line. I am looking for the following solution :
The newline in the text between {{< shortcode >}} .. {{< /shortcode >}} should not be removed.
I want to access each line passed to the shortcode individually so that I can process it in certain way, e.g. highlight first word of every line.
Maybe I was in a hurry not to realize that its not the shortcode problem, but the HTML. I need to either add <pre> or find some other way. Hence, my original quesiton is not valid. But maybe I will let it be there and add my work here to help the future visitors thinking around the same line.