Ionaru / Ionaru/easy-markdown-editor

Image alt text selection activates link button in toolbar

Open
#412 1 comment 0 reactions 0 assignees View on GitHub
Bug
Dominant language
JavaScript
Stars
3.1k
Forks
363
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Setting the cursor in the alt text section of an image incorrectly activates the link button in the toolbar.

**To Reproduce**
`![Alt text](https://example.com/example.jpg)` set cursor in alt text section.

**Additional context**
The CodeMirror state type is set to `image image-alt-text link`. However the EasyMDE `getState()` method returns `link`, see https://github.com/Ionaru/easy-markdown-editor/blob/master/src/js/easymde.js#L333

Contributor guide

Open the contributing guide

Research direction

Start with src/js/easymde.js at the getState() method around line 333, and compare its result with the CodeMirror state when the cursor is in image alt text. Reproduce the issue using the provided image Markdown, then verify that the alt-text state is handled without activating the link toolbar button.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.