Skip to content

Commit

Permalink
fix(domUtil.js): fix #93
Browse files Browse the repository at this point in the history
  • Loading branch information
softvar committed Apr 22, 2021
1 parent 670d564 commit 1516fba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## **v5.0.11** - 22nd April, 2021

- Fix [93](https://github.com/softvar/enhanced-github/issues/93) i.e. repo size not appearing properly because of Readme TOC feature.

## **v5.0.10** - 6th April, 2021

- Fix [89](https://github.com/softvar/enhanced-github/issues/89) i.e. repo size not appearing properly because of Readme TOC feature.
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Enhanced GitHub",
"short_name": "Enhanced GitHub",
"version": "5.0.10",
"version": "5.0.11",
"manifest_version": 2,
"description": "Display repo size, size of each file, download link and option to copy file contents",
"homepage_url": "https://github.com/softvar/enhanced-github",
Expand Down
7 changes: 6 additions & 1 deletion src/utils/domUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ const domUtil = {
if (document.querySelector('readme-toc') && document.querySelectorAll('readme-toc').length) {
elem = document.querySelectorAll('a[href="#readme"]:not(#user-content-readme)')[1];
} else {
elem = document.querySelector('a[href="#readme"]:not(#user-content-readme)');
const readmeEls = document.querySelectorAll('a[href="#readme"]:not(#user-content-readme)');
if (readmeEls && readmeEls.length && readmeEls.length === 2) {
elem = readmeEls[1];
} else {
elem = readmeEls[0];
}
}

if (elem) {
Expand Down

0 comments on commit 1516fba

Please sign in to comment.