hdoc-tools 0.7.17 → 0.7.19

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/hdoc-serve.js CHANGED
@@ -217,7 +217,6 @@
217
217
  let url = req.url;
218
218
 
219
219
  let segs = url.split('/');
220
-
221
220
  if (segs.length == 4 && segs[1] == '_books' && segs[3] == 'book.json') {
222
221
  // Special case of a virtual file here, we need to check the book ID and
223
222
  // if its our book, send the json
@@ -252,7 +251,7 @@
252
251
  }
253
252
 
254
253
  url = url.replace('/_books/', '/');
255
-
254
+
256
255
  console.log('URL Requested:', url);
257
256
 
258
257
  let file_path = path.join(source_path, url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.7.17",
3
+ "version": "0.7.19",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {
@@ -233,7 +233,8 @@ function loadContentUrl(linkRef,fromPageRefresh,fromPopState)
233
233
 
234
234
  //-- for now just load whatever the href prop is (we can add actions to perform specific processing and then load content based on element atts etc)
235
235
  let frontmatterData = {};
236
- fetch("_books/"+linkRef).then(response =>
236
+ let booksLinkRef = linkRef.includes('_books/') ? linkRef : "_books/"+linkRef;
237
+ fetch(booksLinkRef).then(response =>
237
238
  {
238
239
  if(response.headers.has("X-frontmatter"))
239
240
  {