Skip to content

Markdown controls - #40

Open
bidi47 wants to merge 2 commits into
mainfrom
markdown-controls
Open

Markdown controls#40
bidi47 wants to merge 2 commits into
mainfrom
markdown-controls

Conversation

@bidi47

@bidi47 bidi47 commented Jul 31, 2026

Copy link
Copy Markdown
Member

linked to dotkernel/documentation-theme#11
this PR has the js, css to keep the documentation-theme PR clean

bidi47 added 2 commits July 31, 2026 17:35
Signed-off-by: bidi <bidi@apidemia.com>
Signed-off-by: bidi <bidi@apidemia.com>
@bidi47
bidi47 requested a review from alexmerlin July 31, 2026 14:37
Comment thread js/docs.js
Comment on lines +64 to +66
.then(function (markdown) {
return navigator.clipboard.writeText(markdown);
})

@alexmerlin alexmerlin Jul 31, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.then(function (markdown) {
return navigator.clipboard.writeText(markdown);
})
.then(async function (markdown) {
return await navigator.clipboard.writeText(markdown);
})

If you don't wait, then if writeText fails (very unlikely, but possible), the user would see a transition like this:
"Copy Page" -> "Copied" -> "Copy failed" -> "Copy Page"
With an async flow, the messages would show up correctly.

The above is not tested - please test it first!

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