Skip to content

Commit

Permalink
fix: code copy not shown on collapsed divs
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih committed Dec 15, 2023
1 parent ed312fb commit 7ce86b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions samples/seed/articles/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,13 @@ REST API content, independent of platform...

---
```

## Details

<details>
<summary>Demo</summary>

```
root@server# apt-get install nano
```
</details>
2 changes: 1 addition & 1 deletion templates/modern/src/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function renderLinks() {
*/
function renderCodeCopy() {
document.querySelectorAll<HTMLElement>('pre>code').forEach(code => {
if (code.innerText.trim().length === 0) {
if (code.textContent.trim().length === 0) {
return
}

Expand Down

0 comments on commit 7ce86b8

Please sign in to comment.