X-Git-Url: https://ocean-lang.org/code/?a=blobdiff_plain;f=csrc%2Fmdcode.mdc;h=e1498cea31ab05c22628861fc301c3af7d947bdb;hb=6b0b9db85bba00a1a416b2af14f5c2aa2a5eaf5e;hp=8f53d184b21010c3fe6ab64c08146c129919588d;hpb=b757d6738f6ec0a1889e4f07dd49c1e1fd22092d;p=ocean diff --git a/csrc/mdcode.mdc b/csrc/mdcode.mdc index 8f53d18..e1498ce 100644 --- a/csrc/mdcode.mdc +++ b/csrc/mdcode.mdc @@ -800,8 +800,8 @@ This could go wrong if the first line of a code block marked by _`` ``` ``_ is indented. To overcome this we would need to record some extra state in each `code_node`. For now we won't bother. -The indents we insert will all be spaces. This might not work well -for `Makefiles`. +The indents we insert will mostly be spaces. All-spaces doesn't work +for `Makefiles`, so if the indent is 8 or more, we use a TAB first. ##### internal functions @@ -818,7 +818,10 @@ for `Makefiles`. fprintf(out, "#line %d \"%s\"\n", node->line_no, fname); while (len && *c) { - fprintf(out, "%*s", node->indent, ""); + if (node->indent >= 8) + fprintf(out, "\t%*s", node->indent - 8, ""); + else + fprintf(out, "%*s", node->indent, ""); if (node->needs_strip) { if (*c == '\t' && len > 1) { c++;