Skip to content

Commit 235cb29

Browse files
committed
Make <pre> blocks execute the command instead of only the code blocks
1 parent 193b530 commit 235cb29

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pwd-sdk",
3-
"version": "0.0.10",
3+
"version": "0.0.11",
44
"description": "PWD sdk",
55
"main": "dist/index.js",
66
"mainReact": "react/index.js",

src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export function registerInputHandlers(termName, instance) {
1818
var actions = document.querySelectorAll('code[class*="' + termName + '"]');
1919

2020
actions.forEach((a) => {
21-
a.addEventListener("click", function () {
21+
// The parent of <code> blocks is the whole <pre> block
22+
a.parentElement.addEventListener("click", function () {
2223
let cmd = this.innerText;
2324
let dataCmd = this.parentElement.getAttribute("data-command-src");
2425
if (dataCmd) {

0 commit comments

Comments
 (0)