Add preprocess of yaml file

https://github.com/2dust/v2rayN/issues/5646
This commit is contained in:
2dust
2024-09-06 08:57:42 +08:00
parent 7901a59aa4
commit 7ceaf5c071
2 changed files with 32 additions and 3 deletions
@@ -64,6 +64,12 @@
var txtFile = File.ReadAllText(addressFileName);
txtFile = txtFile.Replace(tagYamlStr1, tagYamlStr2);
//YAML anchors
if (txtFile.Contains("<<:") && txtFile.Contains("*") && txtFile.Contains("&"))
{
txtFile = YamlUtils.PreprocessYaml(txtFile);
}
var fileContent = YamlUtils.FromYaml<Dictionary<string, object>>(txtFile);
if (fileContent == null)
{