github / github/markdown-toolbar-element

Bug with unescaped value interpolated into a selector query

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
411
Forks
60
Avg merge
2d 22h
Merged PRs (30d)
6

Description

```
SyntaxError: Failed to execute 'querySelector' on 'Element': '[hotkey="""]' is not a valid selector.
```

https://github.com/github/markdown-toolbar-element/blob/c3630f64cddd29a98bb8b03965e9baa83f585dc4/index.js#L230

Contributor guide

Open the contributing guide

Research direction

Read index.js around line 230 and reproduce the reported querySelector failure using a hotkey value containing a quote. Trace how that value is interpolated into the selector; the issue is done when the reported value no longer produces an invalid selector and the behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.