fix: more strict readme element detection

This commit is contained in:
EnixCoda 2019-10-27 16:16:57 +08:00
parent d23a543c3c
commit 1f632609a6
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD

View file

@ -302,9 +302,9 @@ const clippy = createClippy()
let currentCodeSnippetElement: Element
function attachCopySnippet() {
const readmeSelector = '.repository-content #readme'
const readmeSelector = '.repository-content div#readme'
return $(readmeSelector, () => {
const readmeArticleSelector = '.repository-content #readme article'
const readmeArticleSelector = '.repository-content div#readme article'
$(
readmeArticleSelector,
readmeElement =>
@ -327,7 +327,7 @@ function attachCopySnippet() {
}
}),
() => {
const plainReadmeSelector = '.repository-content #readme .plain'
const plainReadmeSelector = '.repository-content div#readme .plain'
$(plainReadmeSelector, undefined, () =>
raiseError(
new Error('cannot find mount point for copy snippet button while readme exists'),