#Markdown in CV2 causes weird formatting

1 messages · Page 1 of 1 (latest)

soft skiff
#

I have my command formatted to display a leaderboard for highest leveled users, however it formats differently on pc than expected. Mobile works fine. For some reason, newlines start right after markdown (bold) ends. First screenshot (mobile) is what it should be, second screenshot is what it is on pc

#
    @leveling.command(name='leaderboard')
    async def leaderboard(self, ctx: ApplicationContext):
        leaderboard_rows = await LevelingRepository.get_leaderboard(guild_id=ctx.guild.id, limit=10, bot=self.bot)
        if not leaderboard_rows:
            await ctx.respond("No XP data found for this server.", ephemeral=True)
            return

        description_lines = []
        for rank, row in enumerate(leaderboard_rows, start=1):
            user = await self.bot.fetch_user(row.user_id)
            level = LevelingMath.level_from_xp(experience=row.experience)
            description_lines.append(f"**{rank}. {user.display_name}** – Level {level} ({row.experience} XP)")

        message_content = chr(10).join(description_lines)

        print(
            "description_lines: ", description_lines,
            "message_content: ", message_content
        )

        await ctx.respond(
            view=BasicImageView(
                description=message_content
            )
        )
import discord

class BasicImageView(discord.ui.DesignerView):
    def __init__(self, description: str, avatar_url: str = None):
        components = discord.ui.Container(
            discord.ui.TextDisplay(description) if not avatar_url else
            discord.ui.Section(
                discord.ui.TextDisplay(description),
                accessory=discord.ui.Thumbnail(url=avatar_url),
            ),
            colour=discord.Colour.yellow()
        )

        super().__init__(components)
civic idol
#

probably a client issue though

soft skiff
#

Without markdown for the record, no further changes

civic idol
#

i vaguely recall a known issue about unnecessary line breaks in cv2, not sure if there's a timeline on fixing it

soft skiff
#

Hm, thats a shame. This is an eyesore to me PhysicalPain thanks in any case

civic idol
#

allgood