Add regexes and highlighting for in-line commands
This commit is contained in:
@@ -59,7 +59,15 @@ class nwRegEx:
|
||||
FMT_EI = r"(?<![\w\\])(_)(?![\s_])(.+?)(?<![\s\\])(\1)(?!\w)"
|
||||
FMT_EB = r"(?<![\w\\])([\*]{2})(?![\s\*])(.+?)(?<![\s\\])(\1)(?!\w)"
|
||||
FMT_ST = r"(?<![\w\\])([~]{2})(?![\s~])(.+?)(?<![\s\\])(\1)(?!\w)"
|
||||
FMT_IN = r"(?<![\\])(\[[\^_])(.+?)(?<![\\])(\])"
|
||||
FMT_IN = r"(?<![\\])(\[)(b|i|u|s|sup|sub)(:)(.+?)(?<![\\])(\])"
|
||||
|
||||
# Format breakdown of inline codes from FMT_IN
|
||||
INL_EI = r"(?<![\\])(\[i:)(.+?)(?<![\\])(\])"
|
||||
INL_EB = r"(?<![\\])(\[b:)(.+?)(?<![\\])(\])"
|
||||
INL_ST = r"(?<![\\])(\[s:)(.+?)(?<![\\])(\])"
|
||||
INL_UN = r"(?<![\\])(\[u:)(.+?)(?<![\\])(\])"
|
||||
INL_UP = r"(?<![\\])(\[sup:)(.+?)(?<![\\])(\])"
|
||||
INL_DN = r"(?<![\\])(\[sub:)(.+?)(?<![\\])(\])"
|
||||
|
||||
# END Class nwRegEx
|
||||
|
||||
|
||||
@@ -209,8 +209,10 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
self._hRules.append((
|
||||
nwRegEx.FMT_IN, {
|
||||
1: self._hStyles["keyword"],
|
||||
2: self._hStyles["codevalue"],
|
||||
2: self._hStyles["keyword"],
|
||||
3: self._hStyles["keyword"],
|
||||
4: self._hStyles["codevalue"],
|
||||
5: self._hStyles["keyword"],
|
||||
}
|
||||
))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user