diff options
author | Ken Moore <ken@ixsystems.com> | 2017-06-15 13:49:27 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-06-15 13:49:27 -0400 |
commit | ba938deb70ef8709bc13e5886adada43cfb130be (patch) | |
tree | 74270fbaf05207c79fe146df93af955d2ee38cea /src-qt5/desktop-utils/lumina-textedit | |
parent | Fix a quick bug in start-lumina-desktop where it would not stop properly if o... (diff) | |
download | lumina-ba938deb70ef8709bc13e5886adada43cfb130be.tar.gz lumina-ba938deb70ef8709bc13e5886adada43cfb130be.tar.bz2 lumina-ba938deb70ef8709bc13e5886adada43cfb130be.zip |
Add a new markdown syntax highlighting format. Not quite finished yet - but has the bulk of the options so far.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit')
-rw-r--r-- | src-qt5/desktop-utils/lumina-textedit/syntax_rules/md.syntax | 93 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-textedit/tests/test.md | 45 |
2 files changed, 138 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/md.syntax b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/md.syntax new file mode 100644 index 00000000..678431b4 --- /dev/null +++ b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/md.syntax @@ -0,0 +1,93 @@ +# 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", + "regex" : "[\\*]{2}[^\\*]+[\\*]{2}", + "foreground": "colors/altkeyword", + "font_weight" : "bold" + }, + { + "name": "italic", + "regex" : "[\\*]{1}[^\\*]+[\\*]{1}", + "foreground": "colors/altkeyword", + "font_style" : "italic" + }, + { + "name": "bold and italic", + "regex" : "[\\*]{3}[^\\*]+[\\*]{3}", + "foreground": "colors/altkeyword", + "font_weight" : "bold", + "font_style" : "italic" + }, + { + "name": "bold", + "regex" : "[_]{2}[^\\*]+[_]{2}", + "foreground": "colors/altkeyword", + "font_weight" : "bold" + }, + { + "name": "italic", + "regex" : "[_]{1}[^\\*]+[_]{1}", + "foreground": "colors/altkeyword", + "font_style" : "italic" + }, + { + "name": "bold and italic", + "regex" : "[_]{3}[^\\*]+[_]{3}", + "foreground": "colors/altkeyword", + "font_weight" : "bold", + "font_style" : "italic" + }, + { + "name" : "markup", + "regex": "<[a-z].*><\\/[a-z]>", + "foreground" : "colors/class" + }, + { + "name" : "heading", + "regex": "^#+ (.)*$", + "foreground" : "colors/function" + }, + { + "name" : "horizontal rule", + "regex": "^((\\-\\-\\-)|(\\*\\*\\*))$", + "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" + } + ] +} diff --git a/src-qt5/desktop-utils/lumina-textedit/tests/test.md b/src-qt5/desktop-utils/lumina-textedit/tests/test.md new file mode 100644 index 00000000..f9e963c6 --- /dev/null +++ b/src-qt5/desktop-utils/lumina-textedit/tests/test.md @@ -0,0 +1,45 @@ + +# Header + +## Header 2 + +## Header 3 + +*Italic* + +**Bold** + +***Bold and Italic*** + +[link](link) + +Some [link](link) within a text block. + +Some [text](link) within a text block with another [Link](Link) in it. + +Horizontal Rules +--- +*** + +some `in-line code block` test in `a line`. + +some +``` +multi-line +code block +``` +outside block + +quote + +> > I like cheese > whine. +> Is what he said + +* Bullet List + * Indented bullet list + * indented 2 bullet list + +- or this bullet + +1. or this numbered list +2. second item |