pinosaur
/
smdp.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
681708b
)
Bugfix: set the right bits for unordered list.
author
FreeBirdLjj
<ljj11011@mail.ustc.edu.cn>
Fri, 26 Sep 2014 23:50:29 +0000
(07:50 +0800)
committer
FreeBirdLjj
<ljj11011@mail.ustc.edu.cn>
Fri, 26 Sep 2014 23:50:29 +0000
(07:50 +0800)
src/parser.c
patch
|
blob
|
history
diff --git
a/src/parser.c
b/src/parser.c
index
9ce43eb
..
ef7c697
100644
(file)
--- a/
src/parser.c
+++ b/
src/parser.c
@@
-222,22
+222,20
@@
deck_t *markdown_load(FILE *input) {
// delete line
(tmp->text->delete)(tmp->text);
free(tmp);
// delete line
(tmp->text->delete)(tmp->text);
free(tmp);
- } else if(CHECK_BIT(line->bits, IS_UNORDERED_LIST_
1
)) {
+ } else if(CHECK_BIT(line->bits, IS_UNORDERED_LIST_
3
)) {
tmp = line->next;
tmp = line->next;
- line_t *list_last_level_
1
= line;
+ line_t *list_last_level_
3
= line;
while(tmp &&
while(tmp &&
- (CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_1) ||
- CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_2) ||
- CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_3))) {
- if(CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_1)) {
- list_last_level_1 = tmp;
+ CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_3)) {
+ if(CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_3)) {
+ list_last_level_3 = tmp;
}
tmp = tmp->next;
}
}
tmp = tmp->next;
}
- for(tmp = line; tmp != list_last_level_
1
; tmp = tmp->next) {
- SET_BIT(tmp->bits, IS_UNORDERED_LIST_
1
);
+ for(tmp = line; tmp != list_last_level_
3
; tmp = tmp->next) {
+ SET_BIT(tmp->bits, IS_UNORDERED_LIST_
3
);
}
} else if(CHECK_BIT(line->bits, IS_UNORDERED_LIST_2)) {
tmp = line->next;
}
} else if(CHECK_BIT(line->bits, IS_UNORDERED_LIST_2)) {
tmp = line->next;
@@
-255,20
+253,22
@@
deck_t *markdown_load(FILE *input) {
for(tmp = line; tmp != list_last_level_2; tmp = tmp->next) {
SET_BIT(tmp->bits, IS_UNORDERED_LIST_2);
}
for(tmp = line; tmp != list_last_level_2; tmp = tmp->next) {
SET_BIT(tmp->bits, IS_UNORDERED_LIST_2);
}
- } else if(CHECK_BIT(line->bits, IS_UNORDERED_LIST_
3
)) {
+ } else if(CHECK_BIT(line->bits, IS_UNORDERED_LIST_
1
)) {
tmp = line->next;
tmp = line->next;
- line_t *list_last_level_
3
= line;
+ line_t *list_last_level_
1
= line;
while(tmp &&
while(tmp &&
- CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_3)) {
- if(CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_3)) {
- list_last_level_3 = tmp;
+ (CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_1) ||
+ CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_2) ||
+ CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_3))) {
+ if(CHECK_BIT(tmp->bits, IS_UNORDERED_LIST_1)) {
+ list_last_level_1 = tmp;
}
tmp = tmp->next;
}
}
tmp = tmp->next;
}
- for(tmp = line; tmp != list_last_level_
3
; tmp = tmp->next) {
- SET_BIT(tmp->bits, IS_UNORDERED_LIST_
3
);
+ for(tmp = line; tmp != list_last_level_
1
; tmp = tmp->next) {
+ SET_BIT(tmp->bits, IS_UNORDERED_LIST_
1
);
}
}
}
}