From 008bd05459ea07cef707df7227842ac0741b78c2 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Tue, 11 Jul 2023 16:48:02 -0300 Subject: [PATCH] tmp --- shortcodes.rl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/shortcodes.rl b/shortcodes.rl index a0d9ef5..ff29fc3 100644 --- a/shortcodes.rl +++ b/shortcodes.rl @@ -50,9 +50,10 @@ end_b = '>}}'; start = start_p | start_b ; - end = end_p | end_b ; + end = end_p | end_b ;\ shortcode = (start spc name (sep arg)* spc end) + > {sc_start = p-start;}; @ { str_cats(&output, "+++ opening\n"); str_copy(&open_name, &new_name); @@ -86,6 +87,7 @@ str parse(char *input) { char *eof, *ts, *te = 0; int cs, act = 0; + char *start = input; char *p = input; char *pe = p + strlen(input); str open_name, new_name, output, data; @@ -94,6 +96,9 @@ str parse(char *input) { str_init(&output); str_init(&data); + int sc_start = 0; + int sc_end = 0; + char *mark = p; char *data_mark = p; @@ -104,8 +109,8 @@ str parse(char *input) { struct shortcode { str name; - str args; - str content; + int start; + int end; }; int main(int argc, char **argv) {