aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit/syntax_rules
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-06-11 07:09:37 -0400
committerKen Moore <ken@ixsystems.com>2017-06-11 07:09:37 -0400
commitf9729e0a6b15c3d977f6b6e6e9060a554dbe23e0 (patch)
treee6a007eb8aa84a550f0b7cc7d3a59addb759dfe7 /src-qt5/desktop-utils/lumina-textedit/syntax_rules
parentAdd support for a new "file_regex" flag in the JSON syntax manifests that can... (diff)
downloadlumina-f9729e0a6b15c3d977f6b6e6e9060a554dbe23e0.tar.gz
lumina-f9729e0a6b15c3d977f6b6e6e9060a554dbe23e0.tar.bz2
lumina-f9729e0a6b15c3d977f6b6e6e9060a554dbe23e0.zip
Add an XML syntax highlighting rule to LTE. Seems fully-functional.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/syntax_rules')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntax_rules/xml.syntax75
1 files changed, 75 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/xml.syntax b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/xml.syntax
new file mode 100644
index 00000000..3ceb22fa
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/xml.syntax
@@ -0,0 +1,75 @@
+# Syntax support file for the Lumina Text Editor
+# ===================================
+# XML language support rules
+# Written by Ken Moore <ken@ixsystems.com>
+# Released under the 2-clause BSD license
+# ===================================
+
+{
+ "meta": {
+ "name": "XML",
+ "file_suffix": ["xml", "xslt", "jsx", "jrs"]
+ },
+ "format": {
+ "line_wrap": false,
+ "highlight_whitespace_eol" : true,
+ "columns_per_line" : 70,
+ "font_type" : "monospace",
+ "tab_width": 8
+ },
+ "rules": [{
+ "name": "8 spaces rather than a tab",
+ "regex": "([ ]{8})+",
+ "background": "colors/bracket-missing"
+ },
+ {
+ "name": "tabs after spaces",
+ "regex": "( )+\\t",
+ "background": "colors/bracket-missing"
+ },
+ {
+ "name" : "odd number of spaces within indentation",
+ "regex": "(^|\\t)([ ]{2})*[ ](?=\\<)",
+ "background": "colors/bracket-missing"
+ },
+ {
+ "name" : "ID of a tag",
+ "regex": "<[^> ]+[>]?",
+ "font_weight" : "bold",
+ "foreground" : "colors/function"
+ },
+ {
+ "name" : "tag modifiers",
+ "regex" : "\\s[^\\= ]+(?=\\=)",
+ "foreground" : "colors/class"
+ },
+ {
+ "name" : "strings inside a tag",
+ "regex": "\\\"[^\\\"]*\\\"",
+ "foreground" : "colors/text"
+ },
+ {
+ "name" : "comment",
+ "regex_start" : "<!DOCTYPE",
+ "regex_end" : "[/]?>",
+ "foreground" : "colors/comment"
+ },
+ {
+ "name" : "comment",
+ "regex_start" : "<!--",
+ "regex_end" : "-->",
+ "foreground" : "colors/comment"
+ },
+ {
+ "name" : "escapes",
+ "regex" : "&[^;]*;",
+ "foreground" : "colors/preprocessor"
+ },
+ {
+ "name" : "XML preprocessor",
+ "regex_start" : "\\<\\?xml ",
+ "regex_end" : "\\?>",
+ "foreground" : "colors/preprocessor"
+ }
+ ]
+}
bgstack15