klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 295 forks source link

Export File Name Fails to Fill, Strange Errors with Head and Body Tag #430

Closed klembot closed 6 years ago

klembot commented 6 years ago

Originally reported by: Sam Keeper (Bitbucket: SamKeeper, GitHub: Unknown)


This bug title is a bit of a mouthful but I'm assuming these problems, all of which involve the Windows desktop export function in 2.2.0, are linked.

In order:

Hitting the export option calls up the file directory as normal, but instead of an input of "[file_name].html" it instead just says "download". The ".html" has to be added manually. So, that's odd.

The exported file, when opened, now has weird text (eg: PK ���Kyl��y� y� A Host of Gentle Terrors.html") displayed at the top and bottom of the tag. That's pretty strange on its own, but in comparing the DOM tree between these bugged files and properly exported files, I realized that all of the information that SHOULD normally be in the element has now been moved, weirdly, to the element! I am assuming that's part of the bug rather than a reworking of the way Twine operates.

This seems to be a bug present in all story formats, though my attached images are from files running in Sugarcube. The files are what the twine normally looks like, what it looks like when exported from 2.2.0, and the console view for the two files.

Screenshot (1524).png Screenshot (1523).png 2017-12-15 00_57_03-Developer Tools - file____C__Users_Sam%20Keeper_Desktop_AHOGT%20export%20test.ht.png

Also, just so you know, it's currently not possible on here to select 2.2.0 as the version that I'm reporting this bug for. Bugs within bugs.


klembot commented 6 years ago

Original comment by Chris Klimas (Bitbucket: klembot, GitHub: klembot):


Issue #435 was marked as a duplicate of this issue.

klembot commented 6 years ago

Original comment by Chris Klimas (Bitbucket: klembot, GitHub: klembot):


Issue #431 was marked as a duplicate of this issue.

klembot commented 6 years ago

Original comment by Chris Klimas (Bitbucket: klembot, GitHub: klembot):


Fix logic error to prefer regular files instead of zips when publishing

Resolves #430

klembot commented 6 years ago

Original comment by Sam Keeper (Bitbucket: SamKeeper, GitHub: Unknown):


That's odd, when I export on my Windows 8 machine from https://twinery.org/2/#!/stories it exports a .zip file, but the .zip DOES contain what appears to be a properly exported file, without the head section nonsense.

I'm on Windows 8 using Chrome but I'm not sure if that would make a difference.

klembot commented 6 years ago

Original comment by greyelf (Bitbucket: greyelf, GitHub: greyelf):


This bug effects all three release types (install-able, hosted web-browser based, local web-browser based) of the Twine 2 application on Windows, it may also effect Apple machines but I don't have one to test it on.

klembot commented 6 years ago

Original comment by Sam Keeper (Bitbucket: SamKeeper, GitHub: Unknown):


Oh interesting. So there's no jQuery in vanilla Twine now? Out of curiosity what prompted that removal?

klembot commented 6 years ago

Original comment by Chris Klimas (Bitbucket: klembot, GitHub: klembot):


This looks like a howler of a mistake on my part: https://bitbucket.org/klembot/twinejs/commits/bf81aa8e172ba3fd4eb013800227270e34018c0c#chg-src/file/save.js

As part of rewriting the file saving code to remove jQuery, I reversed the logic so that it now prefers to save as a ZIP archive...

klembot commented 6 years ago

Original comment by Chris Klimas (Bitbucket: klembot, GitHub: klembot):


PK ... I think is the beginning signature of a ZIP archive. Which is more than a little weird. I've tagged this as 2.2.0 - Windows for now (I missed adding this version to the bug tracker... bear with me, we just released it last night!) but this may not be Windows-specific.