aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit/syntax_rules/md.syntax
blob: a8e740a0f9fdb4fb26af6b4c3199a5f671257777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Syntax support file for the Lumina Text Editor
# ===================================
#  Markdown language support rules
#  Written by Zackary Welch <zwelch@ixsystems.com>
#  Released under the 2-clause BSD license
# ===================================

{
	"meta": {
		"name": "Markdown",
		"file_suffix": ["md", "markdown"]
	},
	"format": {
		"line_wrap": true,
		"highlight_whitespace_eol" : false,
		"tab_width" : 4
	},
	"rules": [{
			"name": "links",
			"regex": "\\[[^\\[\\]]+\\]\\(#?[^\\s\\]\\)\\[\\(]*\\)",
			"foreground": "colors/keyword"
		},
		{
			"name": "bold and italic",
			"regex" : "(\\s|^)[[\\*]{3}(?!\\s)[^\\*\\_]+(?!\\s)[\\*]{3}(\\s|$)",
			"foreground": "colors/altkeyword",
			"font_weight" : "bold",
			"font_style" : "italic"
		},
		{
			"name": "bold",
			"regex" : "(\\s|^)[\\*]{2}(?!\\s)[^\\*\\_]+(?!\\s)[\\*]{2}(\\s|$)",
			"foreground": "colors/altkeyword",
			"font_weight" : "bold"
		},
		{
			"name": "italic",
			"regex" : "(\\s|^)[\\*](?!\\s){1}[^\\*\\_]+(?!\\s)[\\*]{1}(\\s|$)",
			"foreground": "colors/altkeyword",
			"font_style" : "italic"
		},
		{
			"name": "bold and italic",
			"regex" : "(\\s|^)[_]{3}(?!\\s)[^\\*\\_]+(?!\\s)[_]{3}(\\s|$)",
			"foreground": "colors/altkeyword",
			"font_weight" : "bold",
			"font_style" : "italic"
		},
		{
			"name": "bold",
			"regex" : "(\\s|^)[_]{2}(?!\\s)[^\\*\\_]+(?!\\s)[_]{2}(\\s|$)",
			"foreground": "colors/altkeyword",
			"font_weight" : "bold"
		},
		{
			"name": "italic",
			"regex" : "(\\s|^)[_]{1}(?!\\s)[^\\*\\_]+(?!\\s)[_]{1}(\\s|$)",
			"foreground": "colors/altkeyword",
			"font_style" : "italic"
		},
		{
			"name" : "markup",
			"regex": "<[a-z].*><\\/[a-z]>",
			"foreground" : "colors/class"
		},
		{
			"name" : "heading",
			"regex": "^#+ (.)*$",
			"foreground" : "colors/function"
		},
		{
			"name" : "horizontal rule",
			"regex": "^((\\-\\s*\\-\\s*\\-\\s*)|(\\*\\s*\\*\\s*\\*)|(\\_\\s*\\_\\s*\\_\\s*))$",
			"foreground" : "colors/function"
		},
		{
			"name" : "multi-line code block",
			"regex_start" : "^```$",
			"regex_end" : "^```$",
			"foreground" : "colors/comment"
		},
		{
			"name" : "in-line code block",
			"regex" : "`([^`])+`",
			"foreground" : "colors/comment"
		},
		{
			"name" : "block quote",
			"regex" : "^(\\> )+",
			"foreground" : "colors/keyword"
		},
		{
			"name" : "lists",
			"regex" : "^\\s*([0-9]+.|[\\*\\+\\-]{1})\\s+",
			"foreground" : "colors/function"
		},
		{
			"name" : "text",
			"regex": "\"[^\"\\\\]*(\\\\(.|\\n)[^\"\\\\]*)*\"|'[^'\\\\]*(\\\\(.|\\n)[^'\\\\]*)*'",
			"foreground" : "colors/text"
		}
	]
}
bgstack15