34 Commits

Author SHA1 Message Date
Le Tan
9566e6f5d2 highlight: highlight MathJax formula in editor 2018-04-13 19:51:01 +08:00
Le Tan
2c527201b8 do not highlight verbatim code blocks 2018-04-12 19:31:35 +08:00
Le Tan
117b5471fd bug-fix: merge the code block base format when highlighting code block in edit mode 2018-02-04 13:02:55 +08:00
Le Tan
17b5ac5f66 bug-fix: sort comparator should be irreflexive 2018-01-29 19:31:53 +08:00
Le Tan
217eafd91b HGMarkdownHighlighter: merge formats when highlighting a block 2018-01-17 20:13:28 +08:00
Le Tan
b1f7760ea2 HGMarkdownHighlighter: use cached header info to highlight headers fast 2018-01-16 21:05:35 +08:00
Le Tan
6ba12f7932 bug-fix: add code block indentation in VTextBlockData to get a correct highlight
- Won't treat all the text to the end as code block once we add a new
line within a code block;
- Fix color column by adding the code block indentation bias.
2018-01-01 16:08:26 +08:00
Le Tan
72946d0e15 Markdown Highlighter: more speed 2017-11-30 21:25:28 +08:00
Le Tan
4ec340a403 refactor preview logics
Use block user data to store preview info.
2017-11-29 21:45:20 +08:00
Le Tan
c7cb95d18b Markdown Highlighter: speed up at first parse 2017-11-29 21:45:06 +08:00
Le Tan
fcbd591b69 bug-fix: no more than 6 numbersigns in headings in edit mode 2017-11-24 20:12:37 +08:00
Le Tan
d943e58f13 bug-fix: headings
- Missing headings with special characters;
- Display only the starting block of headers across multiple blocks;
- HGMarkdownHighlighter:
    - Skip headers without spaces after #s;
    - Fix last-block-header issue;
2017-11-24 19:56:58 +08:00
Le Tan
cdcab4884a use HGMarkdownParser to fetch image links from Markdown file 2017-09-16 14:55:42 +08:00
Le Tan
e9238c921e support color column in fenced code block by config color_column 2017-09-12 08:46:39 +08:00
Le Tan
2eb6476c3d support auto heading sequence by config enable_heading_sequence 2017-09-11 19:49:30 +08:00
Le Tan
07e8f27776 optimize VImagePreviewer by flags 2017-09-08 21:41:46 +08:00
Le Tan
bb7e6e196c make markdown highlight interval configurable via markdown_highlight_interval 2017-09-05 20:54:15 +08:00
Le Tan
639d1cb9e9 refactor VCodeBlockHighlightHelper
1. Use QVector instead of QList;
2. Use cache for highlight result;
2017-09-05 20:54:15 +08:00
Le Tan
c3408769b0 refactor VImagePreviewer 2017-09-05 20:54:15 +08:00
Le Tan
73630448a6 move vconfig to a local variable 2017-08-29 09:40:28 +08:00
Le Tan
4730d67393 bugfix: fix nested fenced code block issue
The opening ``` and closing ``` should have the same indentation.
2017-06-03 13:23:04 +08:00
Le Tan
5b150a3634 handle HTML comment correctly 2017-06-01 22:05:02 +08:00
Le Tan
a8614839d9 refactor image preview logics by adding VImagePreviewer
1. Support previewing non-relative local images;
2. Support previewing network images;
2017-05-06 12:25:18 +08:00
Le Tan
bd7f0e6cdd bugfix: abandon obsolete parsed highlight result when text has been changed 2017-04-19 22:32:58 +08:00
Le Tan
44257913f7 support code block syntax highlihgt in edit mode
In edit mode, highlight code blocks via parsing the result of HighlightJS.
We only highlight fenced code blocks by token-matching.

Support custom style in MDHL file.
2017-04-19 15:08:26 +08:00
Le Tan
238983ed0d refine all messages 2017-02-27 22:30:35 +08:00
Le Tan
8db54c45a4 bugfix: do not use reference to hold return value from capturedTexts()
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2017-01-25 22:54:13 +08:00
Le Tan
180ab46367 bugfix: highlight links and images with spaces in URL
It is said that URL should not contain spaces. Anyway, we use regular
expression syntax highlighting to complement PEG Markdown Highlight.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2017-01-22 19:39:43 +08:00
Le Tan
385abb3041 hide image preview block when selected
We do not want user to copy the image preview block (a special char).

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-31 14:13:42 +08:00
Le Tan
c44928e1d8 remove Ctrl+Alt Vim mode
1. Remove Ctrl+ALT Vim mode. Now Ctrl+D will enter the Vim mode
tempararily and only expires after NOT hitting commands for a while;
2. Add d and dd to delete text. 'd2j' is not supported;
3. x will cut the selected text.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-27 09:59:26 +08:00
Le Tan
a22bf1059d preview image links
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-17 12:38:01 +08:00
Le Tan
1a77056f4a support outline in edit mode
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-10 21:59:37 +08:00
Le Tan
51d0eedcb2 fix HGMarkdownHighlighter regular expression
Change the default markdown.css.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-25 10:21:31 +08:00
Le Tan
5fa07864a1 move source stuff into src subdir
Make it convenient to add third-party libraries.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-22 14:11:33 +08:00