A C++ Qt QPlainTextEdit widget with markdown highlighting support and a lot of other extras
MIT License
QMarkdownTextEdit is a C++ Qt QPlainTextEdit widget with markdown highlighting and some other goodies.
Ctrl + Click
Tab
and Shift + Tab
Ctrl + Alt + Down
Ctrl + F
Up
and Down
Escape
Ctrl + R
Commonmark compliance is enforced where possible however we are not fully Commonmark compliant yet. Following is a list of features/extensions supported by the highlighter. Please note that this is just a plaintext editor and as such, it only does the highlighting and not rendering of the markdown to HTML.
Feature | Availablity |
---|---|
Bolds and Italics | Yes |
Lists (Unordered/Orderered) | Yes |
Links and Images(Inline/Reference/Autolinks/E-mail) | Yes (Cannot handle nested links or complex cases yet) |
Heading (ATX and Setext) | Yes |
Codeblocks (indented and fenced) Both backtick and tilde code fences are supported | Yes (Only fenced code block has syntax highlighting) |
Inline code | Yes |
Strikethrough | Yes |
Underline | Yes (Optional) |
Blockquotes | Yes |
Table | Yes |
There are multiple ways to use this. You can use the editor directly, or you can subclass it or you can just use the highlighter.
include (qmarkdowntextedit/qmarkdowntextedit.pri)
QPlainTextEdit
to your UI and promote it to QMarkdownTextEdit
(base class QPlainTextEdit
)add_subdirectory(qmarkdowntextedit)
QPlainTextEdit
to your UI and promote it to QMarkdownTextEdit
(base class QPlainTextEdit
)Highlighter can work with both QPlainTextEdit
and QTextEdit
. Example:
auto doc = ui->plainTextEdit->document();
auto *highlighter = new MarkdownHighlighter(doc);
This SOFTWARE PRODUCT is provided by THE PROVIDER "as is" and "with all faults." THE PROVIDER makes no representations or warranties of any kind concerning the safety, suitability, lack of viruses, inaccuracies, typographical errors, or other harmful components of this SOFTWARE PRODUCT.
There are inherent dangers in the use of any software, and you are solely responsible for determining whether this SOFTWARE PRODUCT is compatible with your equipment and other software installed on your equipment. You are also solely responsible for the protection of your equipment and backup of your data, and THE PROVIDER will not be liable for any damages you may suffer in connection with using, modifying, or distributing this SOFTWARE PRODUCT.