Formatting the WP excerpt for Discourse


#1

We use the Discourse-WP plugin and currently the {excerpt} is being displayed with no line breaks.

Here is an example:
WP Building Skills Of An Online Community Team | FeverBee
Discourse Building Skills Of An Online Community Team - Managing Communities - FeverBee Experts - The Community for Online Community Managers

This doesn’t seem to be the case in other installs that I’ve seen.

Does anyone know of a fix?


(Mittineague) #2

I don’t know the fix, but it sounds like wpautop (WordPress automatic p tags) is involved.

For example, a post is entered with 2 newlines to separate paragraphs.
Instead of 2 <br> tags, (which granted, is not semantic), wpautop converts them to <p> tags while removing whitespace characters in the process.
Discourse removes the <p> tags.

Maybe disable wpautop on the WordPress side, or whitellst p tags Discourse side?


(Simon Cossar) #3

If you manually create an excerpt for the post, the formatting of that excerpt will be retained.

If, instead, you let the wp-discourse plugin create an excerpt for you, all formatting will be stripped. Possibly this is something that should be fixed.


#4

That did the trick thanks!