cec-nuxt-lib 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "cec-nuxt-lib",
3
3
  "configKey": "cec-nuxt-lib",
4
- "version": "0.7.5"
4
+ "version": "0.7.6"
5
5
  }
@@ -132,10 +132,15 @@ onMounted(() => {
132
132
  if (hash) {
133
133
  hash = hash.toLowerCase().replace(/^#/, '').replace(/_/g, ' ');
134
134
  let l = Array.from(document.getElementsByTagName('LABEL')).filter((e) =>
135
- e.innerText.toLowerCase().includes(hash)
135
+ e.innerText.toLowerCase().startsWith(hash)
136
136
  );
137
- if (l.length && l[0].parentNode.tagName === 'SECTION') {
138
- let el = l[0].previousElementSibling;
137
+ let accs = l.filter(
138
+ (e) =>
139
+ e.parentNode.tagName === 'SECTION' ||
140
+ e.parentNode.tagName === 'TEMPLATE'
141
+ );
142
+ if (accs.length) {
143
+ let el = accs[0].previousElementSibling;
139
144
  if (el.tagName === 'INPUT') {
140
145
  el.checked = true;
141
146
  el.scrollIntoView();
@@ -146,7 +151,7 @@ onMounted(() => {
146
151
  let h3s = Array.from(document.getElementsByTagName('H3')).filter((e) =>
147
152
  e.innerHTML.toLowerCase().includes(hash)
148
153
  );
149
- if (h3s) {
154
+ if (h3s.length) {
150
155
  let parent = h3s[0].parentNode;
151
156
  if (parent.tagName === 'ARTICLE') {
152
157
  let el = parent.previousElementSibling;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.7.5",
2
+ "version": "0.7.6",
3
3
  "name": "cec-nuxt-lib",
4
4
  "description": "Nuxt components and assets",
5
5
  "license": "MIT",