mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
HGMarkdownHighlighter: use font family of inline code for MathJax
This commit is contained in:
parent
2123e3abff
commit
15151742c9
@ -49,13 +49,26 @@ HGMarkdownHighlighter::HGMarkdownHighlighter(const QVector<HighlightingStyle> &s
|
|||||||
|
|
||||||
m_codeBlockFormat.setForeground(QBrush(Qt::darkYellow));
|
m_codeBlockFormat.setForeground(QBrush(Qt::darkYellow));
|
||||||
for (int index = 0; index < styles.size(); ++index) {
|
for (int index = 0; index < styles.size(); ++index) {
|
||||||
const pmh_element_type &eleType = styles[index].type;
|
switch (styles[index].type) {
|
||||||
if (eleType == pmh_VERBATIM) {
|
case pmh_VERBATIM:
|
||||||
m_codeBlockFormat = styles[index].format;
|
m_codeBlockFormat = styles[index].format;
|
||||||
} else if (eleType == pmh_LINK) {
|
break;
|
||||||
|
|
||||||
|
case pmh_LINK:
|
||||||
m_linkFormat = styles[index].format;
|
m_linkFormat = styles[index].format;
|
||||||
} else if (eleType == pmh_IMAGE) {
|
break;
|
||||||
|
|
||||||
|
case pmh_IMAGE:
|
||||||
m_imageFormat = styles[index].format;
|
m_imageFormat = styles[index].format;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case pmh_CODE:
|
||||||
|
// Use inline code font family for MathJax format.
|
||||||
|
m_mathjaxFormat.setFontFamily(styles[index].format.fontFamily());
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user