Numbered list changed to lettered list in comments on Wordpress

Howdy!

A reader has pointed out something strange to me. A comment that used numbers on my Discourse site is showing up as letters on my Wordpress site:

Is this a known issue with the Discourse plugin? Is it just my Wordpress install? Please let me know. Thanks!

(The same reader also lamented that the Spoiler Plugin on Discourse doesn’t translate over to Wordpress and that it’s not clear what comments are replies to what, but I don’t know if anything can be done about the former, and I know the latter is already on your radar. :slight_smile: )

3 Likes

I just tested this and got the same result as you. The cause of it is the default WordPress style for ol ol (numbered lists that are inside of a numbered list):

ol ol {
    list-style: lower-alpha;
}

Since WordPress comments are displayed inside of a numbered list, this style rule will be applied to numbered lists in comments unless it is overridden. That can be done with:

ol ol {
    list-style: decimal;
}

Possibly this rule should be added to the plugin’s style sheet.

6 Likes

This has nothing to do with Discourse — it is the CSS rules on your site.

I agree with this complaint. The plugin was designed to pull the best comments from Discourse to WordPress, it wasn’t designed to replicate Discourse comments on WordPress. I don’t think this is the behaviour that people generally expect from the plugin though. What I think people would like would be for the Discourse comments to be displayed in a similar way to how they are displayed with our javascript embed code. For an example of how that looks, see https://blog.codinghorror.com/why-cant-programmers-program/.

When Discourse comments are embedded with javascript, they are displayed on the website in an iframe that is provided by Discourse. I’m wondering if the WP Discourse plugin should add an option to display comments with the Discourse embed code.

One benefit I see with the embedded javascript approach is that work done on improving comment embeds would be available on all types of sites, instead of just WordPress sites. Also, if the WP Discourse plugin only displayed embedded comments, it would significantly reduce the complexity of the plugin’s code.

A possible downside to using embedded comments is that it could lead to increased pageviews on the Discourse site. Unless something has recently changed, each pageview on the blog site that contains embedded comments will count as a pageview on Discourse.

4 Likes

I understand the attraction, but … the downside is that Discourse is an extremely heavy dependency – you’d be pulling across about 1 megabyte of gnarly interpreted javascript just to display a static list of comments. Sort of like killing a fly with a nuclear bomb.

There’s a reason we consistently say “Discourse does not work in an <iframe> and was never intended to.”

1 Like

What I’m proposing is to have the WordPress plugin add our javascript embed code to posts programmatically. I assume that’s similar to what you are doing on your blog. It would be quite simple to have the plugin append the embed script to posts that users wanted to publish to Discourse.

Adding functionality to our embed code is a separate issue. I don’t think we should be trying to recreate Discourse functionality in the iframe. There are two separate problems I’d like to solve. The first is dealing with replies to comments. The second is dealing with displaying spoilers, polls, dates etc.

4 Likes

Howdy Simon! Thank you for the quick reply. :slight_smile: I do think it might make sense to add that list-style suggestion to the plugin’s style sheet, but since @codinghorror pointed out that this might not be your beer and I’m comfortable editing my CSS, is there a way to just target the change you suggested to the Discourse plugin styling? I wouldn’t want to make that change site-wide, since the current behavior makes sense everywhere else.

It certainly was not the behavior I expected or what I’m looking for. I really do want to be able to show all the comments from Discourse about a page over at my site on that page. And I especially want to show that there are lively interactions between readers (i.e. replies), as lively as what has been and is currently possible as with Disqus on my Wordpress site on the page itself.

If I’m understanding correctly, I think something like that might be in the ballpark. Looking at that example, it’s not immediately clear to me what is a reply to what, but it does feel more slick. Part of that is CSS styling, I’d imagine, but the more functional (and understandable and attractive) the Discourse comments appear, the more likely my readers are to take Discourse seriously and give it a try.

Let me be clear: I am not looking for the functionality of Discourse to be embedded on my Wordpress site. It can be a static representation with links to my Discourse install. But when folks can’t even quickly understand who is commenting to whom, they are less likely to even bother clicking over.

As I’ve said before, I think this is a great plugin, so hopefully this doesn’t feel like a complaint. But the more it can depict (even in a static way) how awesome and functional Discourse is, the more likely my readers are to give Discourse a shot. Ditto for how easy the Discourse convos are to parse.

I’ll admit that I don’t fully understand the technical back-and-forth about embedded javascript, but if you think it could make replies more clear and even do things like hide spoilers, show polls, etc. then that would, I think, make why a Discourse community is awesome more clear to folks viewing my Wordpress site. My 2 cents, FWIW.

Thanks, Simon!

1 Like