I have a home page view that renders a list of all of my sites pages. If the summary of one of the pages includes a content snippet with syntax highlighting, the rendered summary on the home page view doesn’t retain the formatting. See the image below:
I tried this snippet of code from that discussion:
I get the content wrapped in the <p> </p> tags (no <!–more–> was specified in the content). But the formatting is still the same. Sounds like that’s consistent with the behavior you were experiencing in that discussion.
Yes I did. I didn’t get the <p> </p> tags wrapped around the Summary content, so I know that conditional block of code was working. It didn’t lead to the results I was hoping for though.
Hmm. I don’t use the summary variable in my personal projects so I’m not familiar with it like others. Sorry I couldn’t help. Perhaps someone else knows a way
Content that comes before the summary divider will be used as that content’s summary and stored in the .Summary page variable with all HTML formatting intact.
I put the <!–more–> summary divider after content and it worked great!