Skip to content

Commit 44c96a3

Browse files
Minor bug fixes
1 parent 7b3608f commit 44c96a3

File tree

6 files changed

+16
-9
lines changed

6 files changed

+16
-9
lines changed

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/trace.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
$.fn.trace = function (o) {
55
const p = "trace.js";
6-
const v = "1.0.0";
6+
const v = "1.0.1";
77

88
$.fn.trace.info = {
99
version: v,
@@ -40,7 +40,11 @@
4040
if (!$(`#trace-highlight-style`).length) {
4141
$("head").append(`<style id="trace-highlight-style">.${cl} { background: ${c}; }</style>`);
4242
}
43-
43+
44+
const styleElement = $("#trace-highlight-style");
45+
if (!styleElement.html().includes(`.${cl} {`)) {
46+
styleElement.append(`.${cl} { background: ${c}; }\n`);
47+
}
4448

4549
return this.each(function () {
4650
$(this).html($(this).html().replace(r, `<span class="${cl}">$1</span>`));

dist/trace.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trace-text-highlighter.js",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Lightweight jQuery Text Highlighter",
55
"main": "dist/trace.min.js",
66
"repository": {

src/trace.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
$.fn.trace = function (o) {
55
const p = "trace.js";
6-
const v = "1.0.0";
6+
const v = "1.0.1";
77

88
$.fn.trace.info = {
99
version: v,
@@ -40,7 +40,11 @@
4040
if (!$(`#trace-highlight-style`).length) {
4141
$("head").append(`<style id="trace-highlight-style">.${cl} { background: ${c}; }</style>`);
4242
}
43-
43+
44+
const styleElement = $("#trace-highlight-style");
45+
if (!styleElement.html().includes(`.${cl} {`)) {
46+
styleElement.append(`.${cl} { background: ${c}; }\n`);
47+
}
4448

4549
return this.each(function () {
4650
$(this).html($(this).html().replace(r, `<span class="${cl}">$1</span>`));

0 commit comments

Comments
 (0)