tabs indentation is not considered as invalid
See original GitHub issueTab indentation will basically result as a non-char when parsing YAML.
For instance:
a:
b:
c: yo mamma
As tab indented comes out as:
js-yaml test.yaml
{ a: null, b: null, c: 'yo mamma' }
It would be safer and easier to debug if the file would not be parseable on tab indent.
Issue Analytics
- State:
- Created 10 years ago
- Reactions:2
- Comments:26 (8 by maintainers)
Top Results From Across the Web
A YAML file cannot contain tabs as indentation - Stack Overflow
A YAML file use spaces as indentation, you can use 2 or 4 spaces for indentation, but no tab. In other words, tab...
Read more >Why is using tabs for indentation invalid in YAML? - Quora
Using tab could lead to inconsistency depends on the environment. In order to be consistent across different environment, spaces is more desirable.
Read more >Tabs and indents settings does not work
Hello,. I have a problem with tab and indents settings. In settings->codestyle->php->tabs&indents I have set tab character for indent.
Read more >TabError inconsistent use of tabs and spaces in indentation
In Python, You can indent using tabs and spaces in Python. Both of these are considered to be whitespaces when you code. So,...
Read more >Invalid indentation, you can use tabs or spaces but not both
I just solve this. As it says, you can't use both tabs and space for indentation. You can change space for indentation in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Everyone who wish to invent “spec improvements” instead of following standard, can continue in fork. That’s out of this project scope.
Greetings. I am one of the creators of YAML. Tabs are not allowed in indentation and an error should happen when they are detected in a place where indentation might occur.
IMHO libyaml is the most perfect implementation of the YAML 1.1 spec (which is very close to YAML 1.2).
Here is the result of the OP test in Perl’s libyaml binding: https://gist.github.com/ac5821875eb30979f7a8 Here is the same program in Python: https://gist.github.com/582ea40dbdcd473249a4
They both throw the same error. I believe it is a wise choice to test arguable behaviors against a libyaml binding. Possibly even moreso than the spec.
FWIW, we spent every day for 3 months (circa 2003) trying to sanely allow tabs into YAML indentation. We came to the conclusion that it was an insane endeavor. (It ends up being much harder than, say, Python indentation based scoping).