got site builder end section working
This commit is contained in:
parent
e5abd6a135
commit
58d7599978
|
@ -32,7 +32,6 @@
|
||||||
#include "4ed_file_moving.h"
|
#include "4ed_file_moving.h"
|
||||||
#include "4ed_meta_parser.cpp"
|
#include "4ed_meta_parser.cpp"
|
||||||
#include "4ed_meta_keywords.h"
|
#include "4ed_meta_keywords.h"
|
||||||
#include "4ed_out_context.cpp"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
char *keys_that_need_codes[] = {
|
char *keys_that_need_codes[] = {
|
||||||
|
|
|
@ -666,6 +666,7 @@ write_enriched_text_html(String *out, Enriched_Text *text, Document_System *doc_
|
||||||
Cmd_EndLink,
|
Cmd_EndLink,
|
||||||
Cmd_Image,
|
Cmd_Image,
|
||||||
Cmd_Video,
|
Cmd_Video,
|
||||||
|
Cmd_EndSection,
|
||||||
// never below this
|
// never below this
|
||||||
Cmd_COUNT,
|
Cmd_COUNT,
|
||||||
};
|
};
|
||||||
|
@ -687,6 +688,7 @@ write_enriched_text_html(String *out, Enriched_Text *text, Document_System *doc_
|
||||||
enriched_commands[Cmd_EndLink] = make_lit_string("END_LINK");
|
enriched_commands[Cmd_EndLink] = make_lit_string("END_LINK");
|
||||||
enriched_commands[Cmd_Image] = make_lit_string("IMAGE");
|
enriched_commands[Cmd_Image] = make_lit_string("IMAGE");
|
||||||
enriched_commands[Cmd_Video] = make_lit_string("VIDEO");
|
enriched_commands[Cmd_Video] = make_lit_string("VIDEO");
|
||||||
|
enriched_commands[Cmd_EndSection] = make_lit_string("END_SECTION");
|
||||||
|
|
||||||
i = command_end;
|
i = command_end;
|
||||||
|
|
||||||
|
@ -767,7 +769,8 @@ write_enriched_text_html(String *out, Enriched_Text *text, Document_System *doc_
|
||||||
body_text = skip_chop_whitespace(body_text);
|
body_text = skip_chop_whitespace(body_text);
|
||||||
|
|
||||||
html_render_section_header(out, body_text, null_string, section_counter);
|
html_render_section_header(out, body_text, null_string, section_counter);
|
||||||
++section_counter->counter[section_counter->nest_level];
|
section_counter->counter[section_counter->nest_level];
|
||||||
|
++section_counter->nest_level;
|
||||||
item_counter = 0;
|
item_counter = 0;
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
|
@ -891,6 +894,18 @@ write_enriched_text_html(String *out, Enriched_Text *text, Document_System *doc_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
|
case Cmd_EndSection:
|
||||||
|
{
|
||||||
|
if (section_counter->nest_level > 0){
|
||||||
|
--section_counter->nest_level;
|
||||||
|
++section_counter->counter[section_counter->nest_level];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
append(out, "<span style='color:#F00'>! Doc generator error: unmatched section end !</span>");
|
||||||
|
fprintf(stderr, "error: unmatched section end\n");
|
||||||
|
}
|
||||||
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include "../meta/4ed_file_moving.h"
|
#include "../meta/4ed_file_moving.h"
|
||||||
#include "../meta/4ed_meta_parser.cpp"
|
#include "../meta/4ed_meta_parser.cpp"
|
||||||
#include "../meta/4ed_meta_keywords.h"
|
#include "../meta/4ed_meta_keywords.h"
|
||||||
#include "../meta/4ed_out_context.cpp"
|
|
||||||
#include "4ed_abstract_document.cpp"
|
#include "4ed_abstract_document.cpp"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
#include "../meta/4ed_file_moving.h"
|
#include "../meta/4ed_file_moving.h"
|
||||||
#include "../meta/4ed_meta_parser.cpp"
|
#include "../meta/4ed_meta_parser.cpp"
|
||||||
#include "../meta/4ed_meta_keywords.h"
|
#include "../meta/4ed_meta_keywords.h"
|
||||||
#include "../meta/4ed_out_context.cpp"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
Loading…
Reference in New Issue