hdoc-tools 0.7.17 → 0.7.18

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.
Files changed (2) hide show
  1. package/hdoc-serve.js +5 -3
  2. package/package.json +1 -1
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
@@ -251,8 +250,11 @@
251
250
  return;
252
251
  }
253
252
 
254
- url = url.replace('/_books/', '/');
255
-
253
+ url = '';
254
+ segs.forEach(function(urlSeg){
255
+ if (urlSeg !== '' && urlSeg !== '_books') url += '/' + urlSeg;
256
+ });
257
+
256
258
  console.log('URL Requested:', url);
257
259
 
258
260
  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.18",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {