I just tried my first manual push of a WP post into a Discourse topic. It worked, but ended up adding HTML that makes the post not look great, and I don’t like that HTML I didn’t specify is being added to my content. Here’s what it posted:
<small>Originally published at: https://original/post/url/
</small><br>Here’s the excerpt . It’s valid…
So it’s adding some formatting tags as well as HTML entities I guess. Not preferable at all… is there a way to prevent this? I just want it to post the exact excerpt content straight from WP, with a clean link back to the original post.
Discourse is designed to handle HTML in the raw content of the posts. Unless you’re seeing HTML entities in the published version (i.e. what appears in the topic when you’re reading it) this is how it’s meant to work, and does work successfully for many Wordpress / Discourse combinations.
You can customise the HTML that is published to Discourse using the tips described here
The reason it is HTML rather than markdown is explained further here
I’m drifting toward off topic here, but HTML is not an issue IMO. But short codes are if a wordpress-post is shown as text on Discourse, because those are stripped off.
I kind of could imagine why this is happening and that’s why I can’t count it as a bug or similar, it is just another limitation.
But I haven’t had any issues with HTML per se. But WordPress itself, depending of theme I guess, will strip off html from excerps quite often, though.
Thanks for the feedback on this. I don’t want to go editing WP files, but there is definitely one serious problem with the way links are pushed from WP to Discourse.
If I paste a link into a topic manually in Discourse, it expands into something pretty, like this:
If however I push a link from WP, the Discourse post appears as this:
I stand corrected, it’s not the small tags, it’s that the link is not on a line of its own. If I edit the resulting Discourse post just to insert a newline at the URL, then it expands into the “pretty” formatting.
You don’t need to. As @Jagster pointed out on your other topic
This is how Wordpress is designed to be used. It’s an open source platform that supports a decent chunk of the sites on the web. This diversity means that the off the shelf settings are never going to satisfy everyone.
Please read the topic I linked. You can change that to your liking using the methods described there
If you get stuck with that just respond to that topic and I’ll help you
The issue was not the small html tags however, it was not having a line break before the URL. And from what I read I would be required to go editing files which I don’t want to get into, and I don’t want to muck about in PHP via a plugin either. At this time I just edit the post and add a line break before the URL each time I publish a post. It’s slightly annoying but not a huge headache. Would of course be better to not have this issue be an issue in the first place but, is what it is.