Improved yaml syntax highlighting
This commit is contained in:
parent
63f6dd4bcb
commit
f518098b07
|
@ -11,17 +11,16 @@ public class YamlLanguage : ILanguage {
|
||||||
public string CssClassName => "yml";
|
public string CssClassName => "yml";
|
||||||
|
|
||||||
public IList<LanguageRule> Rules { get; } = [
|
public IList<LanguageRule> Rules { get; } = [
|
||||||
new LanguageRule(@"(?:\w+):", new Dictionary<int, string> {
|
new LanguageRule(@"(?m)^\s*(#.*)$", new Dictionary<int, string> {
|
||||||
{0, ColorCode.Common.ScopeName.XmlAttribute}
|
{1, ColorCode.Common.ScopeName.Comment}
|
||||||
}),
|
}),
|
||||||
new LanguageRule(@"#(?:.*)\b", new Dictionary<int, string> {
|
new LanguageRule(@"(?s)^(.+)(\-\-\-)", new Dictionary<int, string> {
|
||||||
{0, ColorCode.Common.ScopeName.Comment}
|
{1, ColorCode.Common.ScopeName.XmlCDataSection}
|
||||||
}),
|
}),
|
||||||
new LanguageRule("[^\\\\]\"(?:.*?)[^\\\\]\"", new Dictionary<int, string> {
|
new LanguageRule("""(?m)^\s*(.+:|\- .+)( ".*")?( .+)?""", new Dictionary<int, string> {
|
||||||
{0, ColorCode.Common.ScopeName.String}
|
{1, ColorCode.Common.ScopeName.XmlAttributeValue},
|
||||||
}),
|
{2, ColorCode.Common.ScopeName.String},
|
||||||
new LanguageRule(@"\-(?:\s\w.+)\b", new Dictionary<int, string> {
|
{3, ColorCode.Common.ScopeName.XmlAttribute}
|
||||||
{0, ColorCode.Common.ScopeName.XmlAttributeValue}
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue