Fix visual issues with Discord's new Markdown #6101

Merged
Vexed01 merged 5 commits from enhanced-discord-md into V3/develop 2023-05-13 12:39:57 +02:00
Vexed01 commented 2023-04-25 21:14:19 +02:00 (Migrated from github.com)

Description of the changes

Discord has started rolling out enhanced Markdown to some smaller guilds, including my testing server. I have noticed that many of the help strings no longer format properly when Discord tries to turn them into a list. The issue is where lists are indented beyond the text preceding the list. This PR primarily fixes help strings but a few numbered lists are also adjusted to ensure they format properly.

Current code with an extra indent with the list than the line preceding it:
github.com/Cog-Creators/Red-DiscordBot@ec55622418/redbot/core/core_commands.py (L3105-L3111)

Current formatting in Discord:
DiscordCanary_bDzUA3GKSI

This PR's format in Discord without extra indents:
DiscordCanary_S6R631cndO

I understand not everyone currently has access to the new formatting so if you want a screenshot just ping me, or someone else in testing might be able to who has a server with it or the experiment enabled.

Not sure on an ETA for rollout but for now best to be cautious and not include anything which would look bad on clients without the new formatting (eg # headings will be supported). Maybe if this PR waits for clients to fully support it (would it be able to fit in 3.5.0 now it's been frozen? Is it only feature frozen?) then I will look into user # headings in the help menu instead of bold. But in its current state nothing will look out of place to users without the new Markdown styling.

I can confirm in the guild that has it I can see the new formatting on mobile (Android) so mobile isn't being left behind like sometimes in the past.

Discord they have rolled this out to every guild, so it might be worth looking at adding some # headings but maybe in another PR to improve visuals while this one fixes visual issues.

Have the changes in this PR been tested?

No, for help strings there are so many that I have checked formatting works by using the help command on a subset, and I have manually looked at every edited line (not a blind find and replace).
Yes, all numbered lists have been verified with the bot in Discord by using the associated command.

### Description of the changes Discord has started rolling out enhanced Markdown to some smaller guilds, including my testing server. I have noticed that many of the help strings no longer format properly when Discord tries to turn them into a list. The issue is where lists are indented beyond the text preceding the list. This PR primarily fixes help strings but a few numbered lists are also adjusted to ensure they format properly. Current code with an extra indent with the list than the line preceding it: https://github.com/Cog-Creators/Red-DiscordBot/blob/ec55622418810731e1ee2ede1569f81f9bddeeec/redbot/core/core_commands.py#L3105-L3111 Current formatting in Discord: <img width="552" alt="DiscordCanary_bDzUA3GKSI" src="https://user-images.githubusercontent.com/51716387/234371548-409ff492-f75b-4a35-a793-6f328245608c.png"> This PR's format in Discord without extra indents: <img width="513" alt="DiscordCanary_S6R631cndO" src="https://user-images.githubusercontent.com/51716387/234371571-19e8188a-5f04-48ec-a851-71071a0812b0.png"> ~~I understand not everyone currently has access to the new formatting so if you want a screenshot just ping me, or someone else in testing might be able to who has a server with it or the experiment enabled.~~ ~~Not sure on an ETA for rollout but for now best to be cautious and not include anything which would look bad on clients without the new formatting (eg # headings will be supported). Maybe if this PR waits for clients to fully support it (would it be able to fit in 3.5.0 now it's been frozen? Is it only feature frozen?) then I will look into user # headings in the help menu instead of bold. But in its current state nothing will look out of place to users without the new Markdown styling.~~ ~~I can confirm in the guild that has it I can see the new formatting on mobile (Android) so mobile isn't being left behind like sometimes in the past.~~ Discord they have rolled this out to every guild, so it might be worth looking at adding some # headings but maybe in another PR to _improve_ visuals while this one _fixes_ visual issues. ### Have the changes in this PR been tested? <!-- Choose one (remove the line that doesn't apply): --> No, for help strings there are so many that I have checked formatting works by using the help command on a subset, and I have manually looked at every edited line (not a blind find and replace). Yes, all numbered lists have been verified with the bot in Discord by using the associated command. <!-- If the question doesn't apply (for example, it's not a code change), choose Yes. Please respond to this question truthfully. We do not delay nor reject PRs based on the answer to this question but it allows to better review this PR. -->
Vexed01 (Migrated from github.com) reviewed 2023-04-25 21:25:57 +02:00
@ -889,9 +889,9 @@ class KickBanMixin(MixinMeta):
"""Unban a user from this server.
Vexed01 (Migrated from github.com) commented 2023-04-25 21:25:45 +02:00

Pre-emptive comment - there need to be two spaces here (L894) to ensure the text is indented to the same level as the list. Here Discord treats four spaces as a double indent which does not look good. Four would fit in better with the indentation for the actual code but then Discord for some strange reason assumes the first three spaces mean a single indent and the fourth space is shown as an actual space:
image

Pre-emptive comment - there need to be two spaces here (L894) to ensure the text is indented to the same level as the list. Here Discord treats four spaces as a double indent which does not look good. Four would fit in better with the indentation for the actual code but then Discord for some strange reason assumes the first three spaces mean a single indent and the fourth space is shown as an actual space: ![image](https://user-images.githubusercontent.com/51716387/234381781-a602a1b3-12b3-447e-9fff-9f47c03374f6.png)
Vexed01 (Migrated from github.com) commented 2023-04-25 21:21:41 +02:00

This currently formats as a lettered list. There is the chance that in the future it will change to a numbered list so I'm leaving it as numbers.

image

This currently formats as a lettered list. There is the chance that in the future it will change to a numbered list so I'm leaving it as numbers. ![image](https://user-images.githubusercontent.com/51716387/234381014-ab21d759-d177-4c17-a5fd-d8c41fd4f46f.png)
Kowlin (Migrated from github.com) reviewed 2023-04-30 15:29:24 +02:00
Jackenmen (Migrated from github.com) approved these changes 2023-05-13 12:39:40 +02:00
Jackenmen (Migrated from github.com) left a comment

I can't test whether this renders properly with the Markdown so I'll have to trust you on that but I did verify that it doesn't alter how it looks with the old Markdown. Thanks!

I can't test whether this renders properly with the Markdown so I'll have to trust you on that but I did verify that it doesn't alter how it looks with the old Markdown. Thanks! ![](https://i.fluffy.cc/27MHQpGVHf8zsBqx96gxT5PB5mS1jtjD.gif)
Sign in to join this conversation.
No reviewers
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!6101
No description provided.