Skip to content

Commit 5f26f87

Browse files
committed
fix SSR error
resolves #131 resolves #132
1 parent 2601349 commit 5f26f87

File tree

4 files changed

+20
-26
lines changed

4 files changed

+20
-26
lines changed

dist/svelte-range-slider-pips.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* svelte-range-slider-pips ~ 2.3.0
2+
* svelte-range-slider-pips ~ 2.3.1
33
* Multi-Thumb, Accessible, Beautiful Range Slider with Pips
4-
* © MPL-2.0 ~ Simon Goellner <[email protected]> ~ 24/1/2024
4+
* © MPL-2.0 ~ Simon Goellner <[email protected]> ~ 26/1/2024
55
*/
66
(function (global, factory) {
77
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1623,7 +1623,7 @@
16231623
return child_ctx;
16241624
}
16251625

1626-
// (855:6) {#if float}
1626+
// (853:6) {#if float}
16271627
function create_if_block_2$1(ctx) {
16281628
let span;
16291629
let if_block0_anchor;
@@ -1689,7 +1689,7 @@
16891689
};
16901690
}
16911691

1692-
// (857:10) {#if prefix}
1692+
// (855:10) {#if prefix}
16931693
function create_if_block_4$1(ctx) {
16941694
let span;
16951695
let t;
@@ -1713,7 +1713,7 @@
17131713
};
17141714
}
17151715

1716-
// (857:127) {#if suffix}
1716+
// (855:127) {#if suffix}
17171717
function create_if_block_3$1(ctx) {
17181718
let span;
17191719
let t;
@@ -1737,7 +1737,7 @@
17371737
};
17381738
}
17391739

1740-
// (833:2) {#each values as value, index}
1740+
// (831:2) {#each values as value, index}
17411741
function create_each_block$1(ctx) {
17421742
let span1;
17431743
let span0;
@@ -1876,7 +1876,7 @@
18761876
};
18771877
}
18781878

1879-
// (862:2) {#if range}
1879+
// (860:2) {#if range}
18801880
function create_if_block_1$1(ctx) {
18811881
let span;
18821882
let span_style_value;
@@ -1901,7 +1901,7 @@
19011901
};
19021902
}
19031903

1904-
// (868:2) {#if pips}
1904+
// (866:2) {#if pips}
19051905
function create_if_block$1(ctx) {
19061906
let rangepips;
19071907
let current;
@@ -2212,9 +2212,7 @@
22122212
* @return {string} the text from the input
22132213
*/
22142214
function pureText(possibleHtml) {
2215-
const div = document.createElement("div");
2216-
div.innerHTML = possibleHtml;
2217-
return div.textContent || div.innerText || "";
2215+
return `${possibleHtml}`.replace(/<[^>]*>/g, '');
22182216
}
22192217

22202218
function instance$1($$self, $$props, $$invalidate) {

dist/svelte-range-slider-pips.mjs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* svelte-range-slider-pips ~ 2.3.0
2+
* svelte-range-slider-pips ~ 2.3.1
33
* Multi-Thumb, Accessible, Beautiful Range Slider with Pips
4-
* © MPL-2.0 ~ Simon Goellner <[email protected]> ~ 24/1/2024
4+
* © MPL-2.0 ~ Simon Goellner <[email protected]> ~ 26/1/2024
55
*/
66
function noop() { }
77
function run(fn) {
@@ -1617,7 +1617,7 @@ function get_each_context$1(ctx, list, i) {
16171617
return child_ctx;
16181618
}
16191619

1620-
// (855:6) {#if float}
1620+
// (853:6) {#if float}
16211621
function create_if_block_2$1(ctx) {
16221622
let span;
16231623
let if_block0_anchor;
@@ -1683,7 +1683,7 @@ function create_if_block_2$1(ctx) {
16831683
};
16841684
}
16851685

1686-
// (857:10) {#if prefix}
1686+
// (855:10) {#if prefix}
16871687
function create_if_block_4$1(ctx) {
16881688
let span;
16891689
let t;
@@ -1707,7 +1707,7 @@ function create_if_block_4$1(ctx) {
17071707
};
17081708
}
17091709

1710-
// (857:127) {#if suffix}
1710+
// (855:127) {#if suffix}
17111711
function create_if_block_3$1(ctx) {
17121712
let span;
17131713
let t;
@@ -1731,7 +1731,7 @@ function create_if_block_3$1(ctx) {
17311731
};
17321732
}
17331733

1734-
// (833:2) {#each values as value, index}
1734+
// (831:2) {#each values as value, index}
17351735
function create_each_block$1(ctx) {
17361736
let span1;
17371737
let span0;
@@ -1870,7 +1870,7 @@ function create_each_block$1(ctx) {
18701870
};
18711871
}
18721872

1873-
// (862:2) {#if range}
1873+
// (860:2) {#if range}
18741874
function create_if_block_1$1(ctx) {
18751875
let span;
18761876
let span_style_value;
@@ -1895,7 +1895,7 @@ function create_if_block_1$1(ctx) {
18951895
};
18961896
}
18971897

1898-
// (868:2) {#if pips}
1898+
// (866:2) {#if pips}
18991899
function create_if_block$1(ctx) {
19001900
let rangepips;
19011901
let current;
@@ -2206,9 +2206,7 @@ function normalisedClient(e) {
22062206
* @return {string} the text from the input
22072207
*/
22082208
function pureText(possibleHtml) {
2209-
const div = document.createElement("div");
2210-
div.innerHTML = possibleHtml;
2211-
return div.textContent || div.innerText || "";
2209+
return `${possibleHtml}`.replace(/<[^>]*>/g, '');
22122210
}
22132211

22142212
function instance$1($$self, $$props, $$invalidate) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-range-slider-pips",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"svelte": "src/index.js",
55
"module": "dist/svelte-range-slider-pips.mjs",
66
"main": "dist/svelte-range-slider-pips.js",

src/RangeSlider.svelte

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,7 @@
393393
* @return {string} the text from the input
394394
*/
395395
function pureText(possibleHtml) {
396-
const div = document.createElement("div");
397-
div.innerHTML = possibleHtml;
398-
return div.textContent || div.innerText || "";
396+
return `${possibleHtml}`.replace(/<[^>]*>/g, '');
399397
}
400398
401399
/**

0 commit comments

Comments
 (0)