artasparks / gpub

GPub: Go Publishing for Glift
MIT License
16 stars 3 forks source link

Forward slashes in the copyright JSON cause an error #43

Closed dormerod closed 8 years ago

dormerod commented 8 years ago

This causes problems when you want to include a full URL to some resource (e.g. copyright information).

We could work around this if we had to, but if the fix doesn't take too long it would be good to sort this out before shipping.

Here's the error message:

Compiling with pdflatex
child_process.js:1382
    throw err;
          ^
Error: Command failed: cd /home/project/book && which pdflatex && pdflatex /home/project/book/book.tex

at checkExecSyncError (child_process.js:1339:13)
at Object.execSync (child_process.js:1379:13)
at Object.<anonymous> (/home/dav/Data/git/gpub/scripts/book_gen.js:128:21)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
dormerod commented 8 years ago

Also I discovered inadvertently while testing, that a double backslash creates a new line. Not sure if this is intentional, but it is useful because \n also causes an error.

artasparks commented 8 years ago

Can you paste in the JSON that's problematic?

dormerod commented 8 years ago

The problematic part is "https://".

{
   "publisher": "Foo Publisher",
   "license": "All rights reserved.",
   "publishYear": 2015,
   "firstEditionYear": 2015,
   "isbn": "2370000260451",
   "addressLines": [
      "PO #1111",
      "1111 Mainville Road Rd, Ste 120",
      "Fooville",
      "CA 90001",
      "https://www.fooblar.com"
   ],
   "showPermanenceOfPaper": true,
   "printingRunNum": 1
}
artasparks commented 8 years ago

The copyright is a red herring. It's all http processing.