Skip to content
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

small quirk when using import and continue together #82

Open
pigeonlips opened this issue May 21, 2020 · 2 comments · May be fixed by #83
Open

small quirk when using import and continue together #82

pigeonlips opened this issue May 21, 2020 · 2 comments · May be fixed by #83

Comments

@pigeonlips
Copy link

Wow - love your work. Having heaps of fun using it. A great tool.

Thought i'd point this out as i came across it. Its not a big deal, but it gets a bit confused when you use both import and continue. Heres what i think is happening. after compile, in the second file, it resolves to the same label for the data-section as the first file

<a class="squiffy-link link-section" data-section="_continue1" role="link" tabindex="0">but if i use continue</a>

heres an example ...

file1.squiffy

@import file2.squiffy

Wow - some text

+++lets go on
You'll see this all the time. Its great. Lets go to [[file2]]

file2.squiffy

[[file2]]:
Great import is fantastic. I can split my work into separate files ! 

+++but if i use continue 
i'll never see this text. and be stuck in a loop FOREVER ! 

anyway - not a big deal. Just thought i'd point it out. Can always use [[some other section]] as a workaround.

Thanks for the fantastic tool !

@pigeonlips
Copy link
Author

just incase anyone is disparate to make both work, i hacked around it buy moving ....

var autoSectionCount = 0;

        this.processFileText = function(story, inputText, inputFilename, isFirst) {
            var inputLines = inputText.replace(/\r/g, '').split('\n');

            var compiler = this;
            var lineCount = 0;
            var autoSectionCount = 0;

to line 22 instead

    var marked = require('marked');
    var crypto = require('crypto');
    var autoSectionCount = 0;

As i didn't bother to read more than 8 lines of code, i wont be presumptuous and raise a pull request. I'll leave that for someone that knows what they are doing 😁

@pigeonlips pigeonlips changed the title using import and continue small quirk when using import and continue together May 21, 2020
@pigeonlips pigeonlips linked a pull request May 25, 2020 that will close this issue
@pigeonlips
Copy link
Author

seems to work great. There are other ways to do this (could check to see if the var exists before declaring it and then leave it in the same spot). Anyhoo, have put up a pull to move it to the beginning of the file. Feel free to reject.

Again - thanks for the fantastic tool!

ISibboI added a commit to ISibboI/squiffy that referenced this issue Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant