-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Frontmatter indent #169
Comments
Could you provide examples of ok and not ok input? |
fail ❌ ---
user:
name: sugarshin
url: github.com/sugarshin
--- ok ✅ ---
user:
name: sugarshin
url: github.com/sugarshin
--- Do you understand? |
This depends on what front matter you use. However, it is of course definitely possible to create external rules. For example, to check if the YAML is valid, something like this may work (not tested): var rule = require('unified-lint-rule');
var visit = require('unist-util-visit');
var generated = require('unist-util-generated');
var yaml = require('js-yaml');
module.exports = rule('remark-lint:yaml', yaml);
function yaml(ast, file) {
visit(ast, 'yaml', visitor);
function visitor(node) {
if (!generated(node)) {
try {
yaml.safeLoad(node.value);
} catch (err) {
file.message(err, node)
}
}
}
} I’m closing this in favour of remarkjs/ideas#3. If someone would like to work on this, comment there! |
Why does linter visit the yaml node that remark-frontmatter creates? Was not it supposed to be skipped? |
In the above example, it is created by |
Hi,
I need detect mixed indent with tab in Frontmatter. Is there a way?
The text was updated successfully, but these errors were encountered: