Skip to content

Commit bfe5269

Browse files
committed
highlighter: Make it possible to change color of Markdown headers
Fixes #617.
1 parent 53a54ae commit bfe5269

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

ReText/editor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
'htmlStrings': {'light': '#808000', 'dark': '#d0d070'},
6969
'htmlComments': {'light': '#a0a0a4', 'dark': '#b0b0aa'},
7070
'codeSpans': {'light': '#505050', 'dark': '#afafaf'},
71+
'markdownHeaders': {'light': '#000000', 'dark': '#ffffff'},
7172
'markdownLinks': {'light': '#000090', 'dark': '#8080ff'},
7273
'blockquotes': {'light': '#808080', 'dark': '#b0b0b0'},
7374
'restDirectives': {'light': '#800080', 'dark': '#d070d0'},

ReText/highlighter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class ReTextHighlighter(QSyntaxHighlighter):
119119
(reDblUnderline, NF | QFont.Weight.Bold, Markup.Mkd),
120120
(reTrpAsterisks, ITAL | QFont.Weight.Bold, Markup.Mkd),
121121
(reTrpUnderline, ITAL | QFont.Weight.Bold, Markup.Mkd),
122-
(reMkdHeaders, NF | QFont.Weight.Black, Markup.Mkd),
122+
(reMkdHeaders, FG('markdownHeaders') | QFont.Weight.Black, Markup.Mkd),
123123
(reMkdLinksImgs, FG('markdownLinks'), Markup.Mkd),
124124
(reMkdLinkRefs, ITAL | UNDL, Markup.Mkd),
125125
(reBlockQuotes, FG('blockquotes'), Markup.Mkd),

configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ color name | description
109109
`htmlStrings` | string properties inside HTML tags, e.g. `"baz"` inside `<foo bar="baz">`
110110
`htmlSymbols` | HTML symbols, e.g. `&bar;`
111111
`htmlComments` | HTML comments, e.g. `<!-- comment -->`
112+
`markdownHeaders` | Markdown headers, e.g. `# Header`
112113
`markdownLinks` | Markdown links and images text, e.g. `foo` inside `[foo](http://example.com)`
113114
`blockquotes` | blockquotes, e.g. `> quote` in Markdown
114115
`codeSpans` | code spans, e.g. `` `code` `` in Markdown

0 commit comments

Comments
 (0)