Option to disable sub headers by dashes/equal-signs?
nuttyartist opened this issue · 7 comments
Hi, @pbek!
Is there an option to disable the behaviour of ---
or ===
creating sub headlines?
Or at least/also an option just to disable the background highlighting of these?
Thanks!
Is there an option to disable the behaviour of --- or === creating sub headlines?
Which behaviour are we takling about? 😅
Or at least/also an option just to disable the background highlighting of these?
You could customize the styling completely like QOwnNotes does.
Is there an option to disable the creation of headers by dashes/equals below text
No, not really, that's just Markdown. Why would you want to disable that specific syntax of Markdown?
You could always just override the one method that applies that highlighting.
and to remove the background color on dashes in the second example?
You can just override the style, like in:
No, not really, that's just Markdown. Why would you want to disable that specific syntax of Markdown?
Sometimes I (and I believe many others, especially non Markdown users) just want to create a line seperator below some text without formatting the text above it as a header. But I think I'll keep the current behavior, it's just good to know I can ovveride it.
You can just override the style, like in:
Awesome, thanks!
Two more questions:
- I want to set the font size for code blocks, so they're smaller than the regular text. So I did something like that:
qreal codeBlockFontSize = fontSize - 2;
_formats[static_cast<HighlighterState>(HighlighterState::InlineCodeBlock)].setFontPointSize(codeBlockFontSize);
_formats[static_cast<HighlighterState>(HighlighterState::CodeBlock)].setFontPointSize(codeBlockFontSize);
_formats[static_cast<HighlighterState>(HighlighterState::CodeBlockComment)].setFontPointSize(codeBlockFontSize);
But the size of some syntex of cpp stays the same while the rest does gets smaller (I set a very small number below just to show the difference):
- Do you think you can add marking/highlighting a piece of text syntax like Bear is doing here with two colons around a piece of text to highlight it?
- hard to tell without actually playing around with the code
- since that's no Markdown syntax, it's best to implement that somewhere else. QOwnNotes for example has a script function to do that
That's our customMarkdownHighlighter.cpp. Did I miss any HighlighterState
in my code above?
Well, there are lots of code-states:
qmarkdowntextedit/markdownhighlighter.h
Lines 82 to 177 in b2926ab