Skip to content

Commit 5e5ac74

Browse files
authored
🐛 FIX: Fix edge-case when page is '#' (#132)
1 parent 3199db8 commit 5e5ac74

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sphinx_copybutton/_static/copybutton.js_t

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ if( document.documentElement.lang !== undefined
4444
locale = document.documentElement.lang
4545
}
4646

47-
const path_static = `${DOCUMENTATION_OPTIONS.URL_ROOT}_static/`;
47+
let doc_url_root = DOCUMENTATION_OPTIONS.URL_ROOT;
48+
if (doc_url_root == '#') {
49+
doc_url_root = '';
50+
}
51+
52+
const path_static = `${doc_url_root}_static/`;
4853

4954
/**
5055
* Set up copy/paste for code blocks

0 commit comments

Comments
 (0)