bug-fix: spaces after # are needed for titles in edit mode

This commit is contained in:
Le Tan 2017-08-06 15:33:19 +08:00
parent 586f5c0994
commit d44549a43f

View File

@ -306,7 +306,7 @@ void VMdEdit::generateEditOutline()
// Assume that each block contains only one line // Assume that each block contains only one line
// Only support # syntax for now // Only support # syntax for now
QRegExp headerReg("(#{1,6})\\s*(\\S.*)"); // Need to trim the spaces QRegExp headerReg("(#{1,6})\\s+(\\S.*)"); // Need to trim the spaces
int baseLevel = -1; int baseLevel = -1;
for (QTextBlock block = doc->begin(); block != doc->end(); block = block.next()) { for (QTextBlock block = doc->begin(); block != doc->end(); block = block.next()) {
V_ASSERT(block.lineCount() == 1); V_ASSERT(block.lineCount() == 1);