mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
make the . after section number optional
This commit is contained in:
parent
40a3df305b
commit
2600d12fc2
@ -1 +1 @@
|
||||
Subproject commit 47347580cbcd460ebbbc8358e37b409530edaa2f
|
||||
Subproject commit 96f56ccd3ca6c5037183690cb36b41f716fc0367
|
@ -22,27 +22,27 @@
|
||||
|
||||
#vx-content.vx-section-number h2::before {
|
||||
counter-increment: section1;
|
||||
content: counter(section1) ". ";
|
||||
content: counter(section1) " ";
|
||||
}
|
||||
|
||||
#vx-content.vx-section-number h3::before {
|
||||
counter-increment: section2;
|
||||
content: counter(section1) "." counter(section2) ". ";
|
||||
content: counter(section1) "." counter(section2) " ";
|
||||
}
|
||||
|
||||
#vx-content.vx-section-number h4::before {
|
||||
counter-increment: section3;
|
||||
content: counter(section1) "." counter(section2) "." counter(section3) ". ";
|
||||
content: counter(section1) "." counter(section2) "." counter(section3) " ";
|
||||
}
|
||||
|
||||
#vx-content.vx-section-number h5::before {
|
||||
counter-increment: section4;
|
||||
content: counter(section1) "." counter(section2) "." counter(section3) "." counter(section4) ". ";
|
||||
content: counter(section1) "." counter(section2) "." counter(section3) "." counter(section4) " ";
|
||||
}
|
||||
|
||||
#vx-content.vx-section-number h6::before {
|
||||
counter-increment: section5;
|
||||
content: counter(section1) "." counter(section2) "." counter(section3) "." counter(section4) "." counter(section5) ". ";
|
||||
content: counter(section1) "." counter(section2) "." counter(section3) "." counter(section4) "." counter(section5) " ";
|
||||
}
|
||||
|
||||
#vx-content.vx-constrain-image-width img {
|
||||
|
@ -1100,9 +1100,14 @@ static void increaseSectionNumber(QVector<int> &p_sectionNumber, int p_level, in
|
||||
static QString joinSectionNumberStr(const QVector<int> &p_sectionNumber)
|
||||
{
|
||||
QString res;
|
||||
// TODO: make it configurable? 1.1 or 1.1.?
|
||||
for (auto sec : p_sectionNumber) {
|
||||
if (sec != 0) {
|
||||
res = res + QString::number(sec) + '.';
|
||||
if (res.isEmpty()) {
|
||||
res = QString::number(sec);
|
||||
} else {
|
||||
res += '.' + QString::number(sec);
|
||||
}
|
||||
} else if (res.isEmpty()) {
|
||||
continue;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user