if (at >= main->setting.objects.used) return F_output_not;
// The current FSS standards that have a only spaces to the left of a close so simply print all to the left.
- if ((main->setting.feature & fss_read_feature_flag_object_align_d) && (main->setting.flag & fss_read_main_flag_content_d) && (!(main->setting.flag & fss_read_main_flag_original_d) || (main->setting.flag & fss_read_main_flag_trim_d))) {
- if (at < main->setting.closes.used && main->setting.closes.array[at].start <= main->setting.closes.array[at].stop) {
- f_range_t before = f_range_t_initialize;
-
- if (main->setting.closes.array[at].start) {
- before.start = main->setting.closes.array[at].start;
- before.stop = main->setting.closes.array[at].stop ? main->setting.closes.array[at].stop - 1 : 0;
- }
+ if ((main->setting.feature & fss_read_feature_flag_object_align_d) && (main->setting.flag & fss_read_main_flag_content_d)) {
+ if (!(main->setting.flag & fss_read_main_flag_original_d) || (main->setting.flag & fss_read_main_flag_trim_d)) {
+ if (at < main->setting.closes.used && main->setting.closes.array[at].start <= main->setting.closes.array[at].stop) {
+ f_range_t before = f_range_t_initialize;
+
+ if (main->setting.closes.array[at].start) {
+ before.start = main->setting.closes.array[at].start;
+ before.stop = main->setting.closes.array[at].stop ? main->setting.closes.array[at].stop - 1 : 0;
+ }
- if (before.start <= before.stop) {
- fll_print_except_dynamic_partial(main->setting.buffer, before, delimits, main->program.output.to);
+ if (before.start <= before.stop) {
+ fll_print_except_dynamic_partial(main->setting.buffer, before, delimits, main->program.output.to);
+ }
}
}
}
}
}
}
+ else if (main->setting.flag & fss_read_main_flag_content_d) {
+
+ // An empty Object might still have white space.
+ if (main->setting.contents.array[at].used && main->setting.contents.array[at].array[0].start <= main->setting.contents.array[at].array[0].stop) {
+
+ // Skip past the new line and the object opener.
+ if (main->setting.feature & fss_read_feature_flag_object_as_line_d) {
+ if (main->setting.contents.array[at].array[0].start && main->setting.contents.array[at].array[0].start - 1) {
+ before.stop = main->setting.contents.array[at].array[0].start - 2;
+
+ if (main->setting.open_object.used) {
+ --before.stop;
+ }
+
+ before.start = before.stop;
+
+ while (before.start && main->setting.buffer.string[before.start] != f_string_eol_s.string[0]) --before.start;
+
+ if (main->setting.buffer.string[before.start] == f_string_eol_s.string[0]) ++before.start;
+ }
+ }
+ }
+ }
if (before.start <= before.stop) {
fll_print_except_dynamic_partial(main->setting.buffer, before, delimits, main->program.output.to);