Closed shiffman closed 8 years ago
Something must be going on in my markup as this file builds no problem.
https://github.com/shiffman/The-Nature-of-Code/blob/id_bug/chapters/tip_test.html
Hmm, interesting. Currently, I'm generating those ID's based on the tip's position in the DOM. So maybe they all have the same position in the files? Can you post the files
array I need to have to make this happen, and I'll take a look.
As far as I can tell, any 6 chapters. For example:
https://github.com/shiffman/The-Nature-of-Code/blob/master/magicbook.json
"files":[
"chapters/01_vectors.html",
"chapters/02_forces.html",
"chapters/03_oscillation.html",
"chapters/04_particles.html",
"chapters/05_physicslib.html",
"chapters/06_steering.html"
],
Great. Let me take a look and try to fix this.
I've just confirmed that this is a bug in the ID rendering. Fixing now.
Ok, this is fixed in 0.1.5
. I added a test so we're sure this doesn't happen again:
https://github.com/magicbookproject/magicbook/blob/master/spec/plugins/ids_spec.js#L22-L38
I'm having an error that I can't figure out. I have several instances of
<data-type="tip"></div>
in my book (one per chapter actually). During the build process these get turned into:I've determined that if I ever build the book with more than 5 chapters, I get an error due to a duplicated ID, like somehow the
wpBck
has been generated twice. I am not sure if there is a magic book bug or a bug in my markup.I am going to investigate this more by making some dummy, test files.