Skip to content

Fix Markdown shortcuts inside article toggles - #31523

Draft
Alox1d wants to merge 1 commit into
telegramdesktop:devfrom
Alox1d:fix/iv-toggle-block-shortcuts
Draft

Alox1d wants to merge 1 commit into
telegramdesktop:devfrom
Alox1d:fix/iv-toggle-block-shortcuts

Conversation

@Alox1d

@Alox1d Alox1d commented Oct 25, 2026

Copy link
Copy Markdown

Problem

The article editor rejects its input rules and slash insert menu inside toggle (Details) content. The two input handlers only accept isActiveTopLevelParagraph(), which excludes paragraphs nested inside Details.

Reported in #31518 and #31516.

Changes

  • Introduce State::activeParagraphAllowsInsertShortcuts().
  • Permit the existing input rules and insert suggestions only for top-level paragraphs and paragraph blocks directly inside a Details container.
  • Keep the previous restrictions on quote content, list items, table cells, headings and the toggle title.

The existing MatchInputRule() and block insertion logic are reused, without adding new UI or changing shortcut syntax.

Validation

  • Compiled the actual two production State predicate implementations, extracted against a minimal C++20 model of the existing block paths; regression checks pass for top-level paragraphs, nested Details paragraphs and the excluded quote/list/table/heading/title cases.
  • git diff --check: pass.
  • Not yet verified in the full Telegram Desktop build or GUI. This isolated checkout has no configured CMake/Qt build tree. Opening as a draft until that validation is available.

This PR addresses both reports because the two handlers have the same eligibility guard.

@CLAassistant

CLAassistant commented Oct 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants