Skip to content

🐛 Markdown Toolbar Formatting Issues (Bold / Italic / Strikethrough / Code) #39300

@schourasia750

Description

@schourasia750

🐛 Markdown Toolbar Formatting Issues (Bold / Italic / Strikethrough / Code)

Description

There are issues with the behavior of the markdown formatting toolbar buttons (Bold, Italic, Strikethrough, Inline Code, Multiline Code).

The current behavior creates inconsistent formatting and unexpected nested symbols.


🔴 Issue 1: Button Activation Behavior

Formatting buttons (e.g., Bold) should behave as toggle buttons:

  • When pressed once → activate formatting mode
  • When pressed again → deactivate formatting mode

Currently:

  • Pressing the button simply inserts markdown symbols
  • It does not behave as an active/deactive toggle
  • This causes unexpected formatting when users continue typing

Expected Behavior:

  • Button should visually indicate active state
  • Formatting should apply while active
  • Pressing again should stop formatting

🔴 Issue 2: Duplicate / Nested Markdown Symbols

When applying formatting inside already formatted text, extra symbols are inserted.

Example (Bold case):

Before:

**hi*hello*

After editing:

*hihello*

Observed Problems:

  • Extra * characters are inserted
  • Nested formatting creates broken markdown
  • No validation prevents duplicate or conflicting markers

Expected Behavior:

  • Avoid inserting duplicate markdown symbols
  • Detect if selection is already formatted
  • Cleanly merge or remove formatting without leaving stray characters

🧪 Affected Formatting Buttons

  • Bold (**)
  • Italic (*)
  • Strikethrough (~~)
  • Inline Code (`)
  • Multiline Code (```)

💡 Suggested Improvements

  • Implement proper toggle state for formatting buttons
  • Detect existing formatting before applying new formatting
  • Prevent nested duplicate symbols
  • Ensure clean removal of formatting when toggled off

Environment

  • Latest develop branch
  • Reproducible in message composer

If needed, I can provide a screen recording demonstrating the issue.

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