if(current) {
if(current->closed) {
current->next = node;
+ node->num = current->num + 1;
if(current->parent) {
current->parent->children_end = node;
}
sec.length = MDDocStyleSection_LIST;
sec.style = EDITOR_STYLE_LIST0;
sec.link = NULL;
+ sec.num = n->num;
+ sec.depth = depth;
cxListAdd(sections, &sec);
size_t start_pos = buf->pos;
MDNode *c = n->children_begin;
depth++;
while(c) {
- linearize_mdnodes(buf, sections, c, depth);
+ linearize_mdnodes(buf, sections, c, depth+1);
c = c->next;
}
sec.length = buf->pos - start_pos;
sec.style = EDITOR_STYLE_LIST0;
sec.link = NULL;
+ sec.num = 0;
+ sec.depth = depth;
cxListAdd(sections, &sec);
cxBufferPut(buf, '\n');
sec.length = MDDocStyleSection_IMAGE;
sec.style = n->children_begin ? n->children_begin->text.ptr : NULL;
sec.link = n->link.ptr;
+ sec.num = 0;
cxListAdd(sections, &sec);
} else {
size_t start_pos = buf->pos;
MDNode *c = n->children_begin;
depth++;
while(c) {
- linearize_mdnodes(buf, sections, c, depth);
+ linearize_mdnodes(buf, sections, c, depth+1);
c = c->next;
}
sec.length = buf->pos - start_pos;
sec.style = node_style(n);
sec.link = n->link.ptr;
+ sec.num = 0;
cxListAdd(sections, &sec);
}
}
case MD_BLOCK_QUOTE: return EDITOR_STYLE_QUOTE;
case MD_BLOCK_CODE: return EDITOR_STYLE_CODE_BLOCK;
case MD_BLOCK_UL: return EDITOR_STYLE_PARAGRAPH;
+ case MD_BLOCK_OL: return EDITOR_STYLE_PARAGRAPH;
default: return EDITOR_STYLE_PARAGRAPH;
}
}
sec.length = buf->pos - start_pos;
sec.style = paragraph_style(p);
sec.link = NULL;
+ sec.num = 0;
cxListAdd(sections, &sec);
cxBufferPut(buf, '\n');
ui_set(model->title, note->title);
if(note->content_loaded) {
- // TODO: when multiple note types are implemented, chec contenttype
+ // TODO: when multiple note types are implemented, check contenttype
// and set model->text, model->html or something else
if(!note->contenttype) {
ui_set(model->text, note->content.ptr);