#518: Fix YAML parser

This commit is contained in:
Elio Struyf
2023-03-02 11:50:24 +01:00
parent 026bcd0a84
commit 3b0ea3132c
3 changed files with 7 additions and 3 deletions
+2
View File
@@ -19,6 +19,8 @@
### 🐞 Fixes
- [#518](https://github.com/estruyf/vscode-front-matter/issues/518): Fix an issue where the `YAML` parser adds line breaks to long strings
## [8.3.0] - 2022-02-14 - [Release notes](https://beta.frontmatter.codes/updates/v8.3.0)
### 🧪 Experimental features
+1 -1
View File
@@ -203,7 +203,7 @@ export class ArticleHelper {
noArrayIndent: !indentArray,
skipInvalid: true,
noCompatMode: true,
lineWidth: 500,
lineWidth: 50000,
indent: spaces || 2
} as DumpOptions as any);
}
+4 -2
View File
@@ -1,4 +1,5 @@
import * as yaml from 'yaml';
import * as jsyaml from 'js-yaml';
import * as toml from '@iarna/toml';
import { Format, FrontMatterParser } from '.';
@@ -48,11 +49,12 @@ export const Engines = {
}
}
return docYaml.toString();
const jsonObj = docYaml.toJSON();
return jsyaml.dump(jsonObj, options);
}
}
return yaml.stringify(obj, options);
return jsyaml.dump(obj, options);
}
}
}