diff --git a/lib/v3/script.js b/lib/v3/script.js index 0802065..4ea419a 100644 --- a/lib/v3/script.js +++ b/lib/v3/script.js @@ -29,7 +29,7 @@ const { ScriptEvent } = require('./events'); */ const RE_ANONYMOUS_FUNCTION = /^{?\s*function\s+\(/i; -const RE_STATIC_SCOPE = /\sscope=('module'|"module")/gi; +const RE_STATIC_SCOPE = /\scontext=('module'|"module")/gi; /** @typedef {'default' | 'static' | 'markup'} ScopeType */ diff --git a/test/svelte3/integration/data/data.static.svelte b/test/svelte3/integration/data/data.static.svelte index 0af442f..ae7451a 100644 --- a/test/svelte3/integration/data/data.static.svelte +++ b/test/svelte3/integration/data/data.static.svelte @@ -1,3 +1,3 @@ - \ No newline at end of file diff --git a/test/svelte3/integration/locations/locations.multiscripts.svelte b/test/svelte3/integration/locations/locations.multiscripts.svelte index d910625..b7ca149 100644 --- a/test/svelte3/integration/locations/locations.multiscripts.svelte +++ b/test/svelte3/integration/locations/locations.multiscripts.svelte @@ -1,7 +1,7 @@
Template text
- diff --git a/test/svelte3/integration/locations/locations.spec.js b/test/svelte3/integration/locations/locations.spec.js index bcf621d..a631a49 100644 --- a/test/svelte3/integration/locations/locations.spec.js +++ b/test/svelte3/integration/locations/locations.spec.js @@ -28,13 +28,13 @@ describe('SvelteDoc v3 - Locations', () => { expect(staticVariable, '"staticVariable" should be presented in data items of the doc').to.exist; expect(staticVariable.static).to.be.true; - assertDataItemLocation(staticVariable, 79, 93); + assertDataItemLocation(staticVariable, 81, 95); const local = doc.data.find(p => p.name === 'variable'); expect(local, '"variable" should be presented in data items of the doc').to.exist; expect(local.static).to.be.false; - assertDataItemLocation(local, 127, 135); + assertDataItemLocation(local, 129, 137); done(); }).catch(e => { diff --git a/test/unit/helpers/helpers.spec.js b/test/unit/helpers/helpers.spec.js index ea1eaef..9653a25 100644 --- a/test/unit/helpers/helpers.spec.js +++ b/test/unit/helpers/helpers.spec.js @@ -30,7 +30,7 @@ let variable = 1; it('When html block have attribute, should be correct extracted', () => { const content = `Some content here
- `; @@ -41,7 +41,7 @@ let variable = 1; const block = result.block; expect(block).is.exist; - expect(block.attributes).is.eq(' scope="module"'); + expect(block.attributes).is.eq(' context="module"'); }); it('When startIndex are specified, should be skip first content and provide the next item', () => { @@ -138,7 +138,7 @@ export let items = [];
{@html highlight(
'