slweb

Једноставни генератор статичких веб страна
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување a929ede87178108513dede0267f453b482d2d1b2
родитељ ee901138a0309940b74aaa60bb2f5d3760ddb2cc
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Mon, 25 Jan 2021 06:56:05 +0100

Output math formula code if KaTeX not present

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
Mindex.html | 2+-
Mslweb.c | 12+++++++-----
измењених датотека: 2, додавања: 8(+), брисања: 6(-)

diff --git a/index.html b/index.html @@ -136,7 +136,7 @@ this program. If not, see &lt;<a href="https://www.gnu.org/licenses">https://www <div id="git-log"> Previous commit: -index.slw 5144730 2021-01-24 22:09:25 +0100 (Страхиња Радић) (HEAD -> master, tag: v0.3.6, origin/master, origin/HEAD) +index.slw 90fe7e2 2021-01-25 06:59:09 +0100 (Страхиња Радић) (HEAD -> master, origin/master, origin/HEAD) </div><!--git-log--> diff --git a/slweb.c b/slweb.c @@ -281,9 +281,7 @@ print_command(uint8_t* command, FILE* output, BOOL strip_newlines) strip_newlines ? "" : "\n"); } free(cmd_output_line); - pclose(cmd_output); - - return 0; + return pclose(cmd_output); } int @@ -1467,15 +1465,19 @@ int process_formula(FILE* output, uint8_t* token, BOOL display_formula) { uint8_t* command = NULL; + int result = 0; CALLOC(command, uint8_t, BUFSIZE) u8_snprintf(command, BUFSIZE-1, "katex <<<'%s%s'", display_formula ? "\\displaystyle " : "", token); - print_command(command, output, TRUE); + + result = print_command(command, output, TRUE); + if (result) + print_output(output, "%s", token); free(command); - return 0; + return result; } int