summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormongo <andmarti@gmail.com>2023-06-01 09:55:25 -0300
committermongo <andmarti@gmail.com>2023-06-01 09:55:25 -0300
commita653dc2908b949fb3b382974c4375d8b6684abbc (patch)
treee3ce52d88cefe0110b36d7333e93411cc153af15
parentc00d55ea5359e3adfbdb925218ab8d8f7f34fc97 (diff)
parent3ca132ebb85619413ac60c4af0e67a8f3915d595 (diff)
Merge branch 'pr-776' into dev
-rw-r--r--src/file.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/file.c b/src/file.c
index 68e8d36..8a620a2 100644
--- a/src/file.c
+++ b/src/file.c
@@ -1518,24 +1518,6 @@ void export_markdown(char * fname, int r0, int c0, int rn, int cn) {
(void) fprintf (f, " | ");
}
- //make header border of dashes with alignment characters
- if (row == 0) {
- if (col == c0) strcat (dashline, "|");
- if (align == 0) {
- strcat (dashline, ":");
- } else {
- strcat (dashline, "-");
- }
- for (dash_num = 0; dash_num < roman->cur_sh->fwidth[col]; dash_num++) {
- strcat (dashline, "-");
- }
- if(align >= 0) {
- strcat (dashline, ":");
- } else {
- strcat (dashline, "-");
- }
- strcat (dashline, "|");
- }
if (*pp) {
num [0] = '\0';
@@ -1570,7 +1552,6 @@ void export_markdown(char * fname, int r0, int c0, int rn, int cn) {
}
}
-
pad_and_align (text, num, roman->cur_sh->fwidth[col], align, 0, out, roman->cur_sh->row_format[row]);
wchar_t new[wcslen(out)+1];
@@ -1596,6 +1577,27 @@ void export_markdown(char * fname, int r0, int c0, int rn, int cn) {
} else {
fprintf (f, "%*s", roman->cur_sh->fwidth[col], " ");
}
+
+ // Make header border of dashes with alignment characters
+ // Column alignment is bases on cell alignments of first row
+ if (row == 0) {
+ if (col == c0) strcat (dashline, "|");
+ if (align == 0) {
+ strcat (dashline, ":");
+ } else {
+ strcat (dashline, "-");
+ }
+ for (dash_num = 0; dash_num < roman->cur_sh->fwidth[col]; dash_num++) {
+ strcat (dashline, "-");
+ }
+ if(align >= 0) {
+ strcat (dashline, ":");
+ } else {
+ strcat (dashline, "-");
+ }
+ strcat (dashline, "|");
+ }
+
}
fprintf(f," |\n");
}