mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🐛 Fix: remove the leading and trailing whitespace of the code string (#205)
This commit is contained in:
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
> Snapshot: <>
|
||||
|
||||
- :bug: Fix: remove the leading and trailing whitespace of the code string ([#205](https://github.com/hugo-fixit/FixIt/issues/205))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.16...v0.2.17`](https://github.com/hugo-fixit/FixIt/compare/v0.2.16...v0.2.17)
|
||||
|
||||
## v0.2.16 [2022.9.24]
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
-1
@@ -498,7 +498,8 @@ class FixIt {
|
||||
const $copy = document.createElement('span');
|
||||
$copy.insertAdjacentHTML('afterbegin', '<i class="fa-regular fa-copy fa-fw" aria-hidden="true"></i>');
|
||||
$copy.classList.add('copy');
|
||||
const code = $code.innerText;
|
||||
// remove the leading and trailing whitespace of the code string
|
||||
const code = $code.innerText.trim();
|
||||
if (this.config.code.maxShownLines < 0 || code.split('\n').length < this.config.code.maxShownLines + 2) {
|
||||
$chroma.classList.add('open');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user