Skip to content

Markdown inconsistencies in cv2 containers.Β #7993

@Intenzi

Description

@Intenzi

Description

  1. Singe-line code block formatting (`) works weird on containers for mobile app, and has some spacing issue
    making it unable to replicate what is seen on web/pc discord ui.

  2. Hyperlinks with any emotes break when forwarded from inside a container.

  • a. Hyperlinks with emotes don't get markdown enabled, unless you use an interaction (such as slash cmd/ui click callback).
  • b. When hyperlinked successfully, it breaks when the message is forwarded.
  1. Containers seem to have a larger different font size for triple header ### markdown than the default font size.
    Not a bug as its consistent on all platforms and kinda useful, but just something weird that doesn't happen outside of containers.

Steps to Reproduce

a sample payload

{
  "flags": 32768,
  "components": [
    {
      "type": 17,  // ComponentType.CONTAINER
      "accent_color": 703487,
      "components": [
        {
          "type": 10,  // 1. different spacing on mobile and web ui
          "content": "### `%  | Test       | Hi world !`\n`%  | Wow       | Hi there !`"
        },
        {
          "type": 10,  // 2. breaks on forward
          "content": "[⚑ Forward this](<https://www.google.com/>)"
        },
        {
          "type": 10,  // 3. different font size?
          "content": "### Quick brown fox\n**Quick brown fox**"
        }
      ]
    }
  ]
}

I use discord.py so I'll be giving a sample code of the same as well (call via jishaku)

import discord
from discord import ui

class MyView(ui.LayoutView):
    def __init__(self):
        super().__init__(timeout=15)

        container = ui.Container()
        container.add_item(ui.TextDisplay("### `%  | Wow     | Hi world !`\n`%  | Wow       | Hi there !`"))
        # use any emoji here non-custom/custom
        container.add_item(ui.TextDisplay(f" [πŸ“Š Forward me](https://www.google.com/)\nokay"))
        container.add_item(ui.TextDisplay("### Quick brown fox\n**Quick brown fox**"))
        self.add_item(container)

# Needed to be able to hyperlink emote
class Button(ui.Button):
    async def callback(self, itx):
        await itx.response.send_message(view=MyView())

# jishaku specific calling, can also use a slash or msg command
_ = await _channel.send(view=ui.View().add_item(Button(label="Test")))

Expected Behavior

  1. Expect the code block to be spaced by the amount of spacegaps provided, the way they are on web ui.
Image
  1. Expect the hyperlink to remain a hyperlink in forwarded messages.

  2. Normally would expect it to be the same size as regular font size.

Current Behavior

  1. Spacing is irregular on mobile vs above shown expected in web ui for code blocks.
  2. Emote hyperlinks break markdown when forwarded.
  3. Larger size for ### smallest header markdown.
Image

Screenshots/Videos

No response

Client and System Information

App: 305.12 (305012) googleRelease; Manifest: "61e922e1ac65927542cf5a52e922fe29"; Build Override: N/A; Device: OP535DL1 (CPH2381) OS 34;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions