Formatting the WP excerpt for Discourse

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

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

Does anyone know of a fix?

1 Like

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?

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.

8 Likes

That did the trick thanks!

2 Likes