mirror of
https://github.com/MetaCubeX/subconverter.git
synced 2025-11-04 18:19:42 +08:00
Make indentation in Clash profile consistent (#559)
This commit is contained in:
parent
a60551ac11
commit
d3fa05a8fd
@ -177,7 +177,7 @@ std::string rulesetToClashStr(YAML::Node &base_rule, std::vector<RulesetContent>
|
|||||||
if(!overwrite_original_rules && base_rule[field_name].IsDefined())
|
if(!overwrite_original_rules && base_rule[field_name].IsDefined())
|
||||||
{
|
{
|
||||||
for(size_t i = 0; i < base_rule[field_name].size(); i++)
|
for(size_t i = 0; i < base_rule[field_name].size(); i++)
|
||||||
output_content += " - " + safe_as<std::string>(base_rule[field_name][i]) + "\n";
|
output_content += " - " + safe_as<std::string>(base_rule[field_name][i]) + "\n";
|
||||||
}
|
}
|
||||||
base_rule.remove(field_name);
|
base_rule.remove(field_name);
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ std::string rulesetToClashStr(YAML::Node &base_rule, std::vector<RulesetContent>
|
|||||||
strLine += "," + rule_group;
|
strLine += "," + rule_group;
|
||||||
if(count_least(strLine, ',', 3))
|
if(count_least(strLine, ',', 3))
|
||||||
strLine = regReplace(strLine, "^(.*?,.*?)(,.*)(,.*)$", "$1$3$2");
|
strLine = regReplace(strLine, "^(.*?,.*?)(,.*)(,.*)$", "$1$3$2");
|
||||||
output_content += " - " + strLine + "\n";
|
output_content += " - " + strLine + "\n";
|
||||||
total_rules++;
|
total_rules++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -228,7 +228,7 @@ std::string rulesetToClashStr(YAML::Node &base_rule, std::vector<RulesetContent>
|
|||||||
strLine += "," + rule_group;
|
strLine += "," + rule_group;
|
||||||
if(count_least(strLine, ',', 3))
|
if(count_least(strLine, ',', 3))
|
||||||
strLine = regReplace(strLine, "^(.*?,.*?)(,.*)(,.*)$", "$1$3$2");
|
strLine = regReplace(strLine, "^(.*?,.*?)(,.*)(,.*)$", "$1$3$2");
|
||||||
output_content += " - " + strLine + "\n";
|
output_content += " - " + strLine + "\n";
|
||||||
total_rules++;
|
total_rules++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user