@gudhub/ssg-web-components-library 1.0.21 → 1.0.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/ssg-web-components-library",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -8,7 +8,6 @@ class HtmlTemplate extends GHComponent {
8
8
 
9
9
  let chapter = await window.getCurrentChapter();
10
10
  let ids = await super.findIds(chapter);
11
-
12
11
  let customHtml;
13
12
 
14
13
  try {
@@ -19,16 +18,21 @@ class HtmlTemplate extends GHComponent {
19
18
  customHtml = await fetch(fileInfo.url);
20
19
  customHtml = await customHtml.text();
21
20
  } catch (error) {
22
- console.log(error)
23
21
  customHtml = false;
24
22
  }
25
23
  if (customHtml) {
26
24
  const body = document.querySelector('body');
27
- body.innerHTML = customHtml;
25
+ const wrapper = document.createElement('div');
26
+ wrapper.id = 'layout';
27
+ wrapper.innerHTML = customHtml;
28
+
29
+ body.appendChild(wrapper);
28
30
 
29
31
  const links = body.querySelectorAll('link');
30
32
  this.attachLinks(links);
31
33
  }
34
+
35
+ this.remove();
32
36
  }
33
37
 
34
38
  attachLinks(links) {