Skip to content

feat(text-editor): find the separator line slash command by 'divider' and 'hr' - #11092

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:feat/divider-slash-alias
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:feat/divider-slash-alias

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

Fixes #9326

Problem and change

The slash command popup filters items only by their translated label, so typing /divider or /hr (common names in other markdown editors) found nothing; only 'Separator line' matched.

SelectPopupValueType gets an optional keywords list, SelectPopup matches the search term against the label/text and these keywords via a small matchesSearch helper, and the separator line inline command declares 'divider' and 'hr' as keywords. Covered by a unit test for matchesSearch.

Tests

matchesSearch.test.ts. Manual: in an editor, /divider and /hr offer "Separator line"; /sep still works. Items without keywords filter exactly as before.

… and 'hr'

The slash command popup filters items only by their translated label, so typing /divider or /hr (common names in other markdown editors) found nothing; only 'Separator line' matched.

SelectPopupValueType gets an optional keywords list, SelectPopup matches the search term against the label/text and these keywords via a small matchesSearch helper, and the separator line inline command declares 'divider' and 'hr' as keywords. Covered by a unit test for matchesSearch.

Fixes hcengineering#9326

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>

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.

Markdown editor: Shortcut for separator line should also be divider

1 participant