Giter VIP home page Giter VIP logo

Comments (9)

leebyron avatar leebyron commented on September 6, 2024

Sorry to hear you encountered problems with this tool.

I've tried to reproduce this issue and can't seem to. I added a test runner along with this case in the linked commit which shows a proper parse and print.

I'd be happy to re-open this issue and address a fix if you have an example of a specific document which is still failing with this error.

from spec-md.

csuwildcat avatar csuwildcat commented on September 6, 2024

I am experiencing the same exact issue - all combinations of the examples provided in the docs all produce the same error that there is no valid title, when there clearly is. In trying to find commonality between my situation and the other person who had this issue, may I ask if you are testing against Windows?

from spec-md.

csuwildcat avatar csuwildcat commented on September 6, 2024

For reference, I just ran the tool on your own documentation as a test, and it produced the following error:

Error: SyntaxError: spec.md:65:36
# [Contributing](./CONTRIBUTING.md)
                                   ^
Expected " ", "#", [# ] or [^\n\r# ] but end of input found.    at formatError 

from spec-md.

csuwildcat avatar csuwildcat commented on September 6, 2024

Update: I isolated that last bug I posted, and found it is caused by not having a return line under your last line of text.

After resolving that error, the tool returned to throwing the same Setext Title error I mentioned previously.

from spec-md.

leebyron avatar leebyron commented on September 6, 2024

I’m happy to reopen this if there’s a reproducible test case. It’s entirely possible that this is a Windows issue. The tests for this repo run on Linux.

from spec-md.

csuwildcat avatar csuwildcat commented on September 6, 2024

I’m happy to reopen this if there’s a reproducible test case. It’s entirely possible that this is a Windows issue. The tests for this repo run on Linux.

I just used WSL to run it in Linux but it produced the same error. Not sure what to do about steps-to-reproduce, because I am literally just trying to parse both the simplest example of a near empty doc, as well as the various MDs in your repo. I really would love to use this tool, because I haven't seen anything that enables markdown use for specifications of this caliber.

from spec-md.

csuwildcat avatar csuwildcat commented on September 6, 2024

Just to be exhaustive, I cloned the actual spec-md repo and ran the simple-header test in both Windows and Linux (WSL Ubuntu) and still got the same error:

simple-header/input.md is missing a title. It must begin with a Setext-style header. Example:

Title of Spec
=============

from spec-md.

csuwildcat avatar csuwildcat commented on September 6, 2024

Further down the rabbit hole: I did a global install of the package, invoked the tool from the console within the global package, and to my surprise, that worked for rendering the test doc in the module. But the wild thing so far is that when I use the same globally installed module and invoke it from within my project folder, no dice, it throws the Setext Title error.

from spec-md.

csuwildcat avatar csuwildcat commented on September 6, 2024

OK, I think I have identified the issue. After stepping through grammar.js and testing/logging all the ops and calls inside of parsetitle(). Something looked a bit off with some of the substr() returns, namely, it would print what looked to be the same string, then check equality to whatever the next step's value is. Visually they looked the same, but after I checked their lengths, one was always being returned with an additional char: '=== ' vs '==='.

When the code hits this line in grammar.js: if (input.substr(peg$currPos, 3) === peg$c7), I believe it should be finding them equal, but one of the strings has a hanging space character. When I modified that one bit of code to this: if (input.substr(peg$currPos, 4).trim() === peg$c7), the file is parsed/generated just about right, except individual lines in paragraphs are being separated into their own paragraphs. I am not sure if that is a separate bug, or related to the change I made above.

from spec-md.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.