Skip to content

Commit b615f9c

Browse files
fix: update speech.js selectors to work without .guide class
1 parent f5346ed commit b615f9c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

assets/speech.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232

3333
/** 過濾出可朗讀的區塊 */
3434
function collectReadableNodes(container) {
35+
// 支援 .guide 內或直接在 container 內的元素
3536
const selectors =
36-
".guide h2, .guide h3, .guide h4, .guide p, " +
37-
".guide li, .guide td, .guide th, .guide blockquote, " +
38-
".guide .callout, .guide .outcome, " +
39-
".guide .demo-block > pre, .guide .demo-block > .demo-render";
37+
"h2, h3, h4, p, li, td, th, blockquote, " +
38+
".callout, .outcome, " +
39+
".demo-block > pre, .demo-block > .demo-render";
4040
const nodes = Array.from(container.querySelectorAll(selectors));
4141
// 只保留有實質文字的
4242
return nodes.filter((n) => {

0 commit comments

Comments
 (0)