-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Harlowe] "...must be followed by a Harlowe-hook" error caused by tabs in code #78
Comments
This was actually fixed on the develop branch, which is stable and usable,
but untested yet unfortunately.
…On Mon, Mar 4, 2019, 4:19 PM S. Darkwell ***@***.***> wrote:
A passage containing the following code (which contains a tab between ')'
and '[' results in error "Story format transcoding failed at passage
FirstPassage: 'if' must be followed by a Harlowe-hook.":
(if: $test is 0) [test]
The generated json contains the following entry for the tab character:
{
"text": "\t\,
"type": "text"
},
The error can be prevented via the brute-force method of pre-loading the
file, removing all tab characters, then saving the file before it is parsed
by PhantomJS, but this won't work as a real-world solution.
I spent a number of hours attempting to fix this in a more elegant way,
but my unfamiliarity with the code limited my progress. If anyone more
familiar with this than I am can push a fix, it would be much appreciated!
- S.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#78>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABwejOgijKIpaknyq8I1Vwm9nhiNrvMHks5vTStngaJpZM4bccJY>
.
|
Ah! I see that. I didn't even think to look there. Apologies. Thank you! |
Hello. I've downloaded the development branch and tried it with both the .dll files and the .src files, and the errors still exist. It appears that an whitespace between and (if:) and [] will result in an error. For example:
Thank you! |
Was this solved eventually? :) I have the same error importing my twine file :( |
@keimax The source code is available for you to change. |
A passage containing the following code (which contains a tab between ')' and '[' results in error "Story format transcoding failed at passage FirstPassage: 'if' must be followed by a Harlowe-hook.":
(if: $test is 0) [test]
The generated json contains the following entry for the tab character:
The error can be prevented via the brute-force method of pre-loading the file, removing all tab characters, then saving the file before it is parsed by PhantomJS, but this won't work as a real-world solution.
I spent a number of hours attempting to fix this in a more elegant way, but my unfamiliarity with the code limited my progress. If anyone more familiar with this than I am can push a fix, it would be much appreciated!
- S.
The text was updated successfully, but these errors were encountered: