Comments (9)
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.
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.
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.
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.
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.
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.
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.
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.
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)
- Feature Suggestions HOT 4
- Permission error when installing HOT 1
- TypeError HOT 4
- LaTeX support solved HOT 1
- Add support for relative file links with space in the file name HOT 1
- Spec-MD does not operate correctly in Windows HOT 4
- Task lists / checkboxes HOT 1
- Infinite loop when the same Note is used 29 times or more HOT 1
- Tables with one column are not supported
- Link to return to top
- Section links don't work correctly
- Handle <pre> tags verbatim, including newlines and whitespace HOT 1
- Space removed around single-quoted word during typographic quote conversion
- Extraneous commas
- Support `::` in references/algorithms
- Dark Mode HOT 3
- Weird scroll bar in pre tags HOT 2
- TypeError: Cannot read property 'value' of null HOT 2
- Should underscores cause parse error in Definition Lists? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spec-md.