From b99435279a281f2c541100b693c96e67d6c1bd62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Sat, 29 Apr 2023 23:18:31 +0200 Subject: Allow to specify the format of the documentation Helps the consumers of the documentation to assume that the documentation is using gtk-doc format or gi-docgen. --- girepository/girparser.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'girepository/girparser.c') diff --git a/girepository/girparser.c b/girepository/girparser.c index 3edeac34..31ba5839 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -97,7 +97,8 @@ typedef enum STATE_ALIAS, STATE_TYPE, STATE_ATTRIBUTE, - STATE_PASSTHROUGH + STATE_PASSTHROUGH, + STATE_DOC_FORMAT /* 35 */ } ParseState; typedef struct _ParseContext ParseContext; @@ -2918,6 +2919,11 @@ start_element_handler (GMarkupParseContext *context, state_switch (ctx, STATE_PASSTHROUGH); goto out; } + else if (strcmp (element_name, "doc:format") == 0) + { + state_switch (ctx, STATE_DOC_FORMAT); + goto out; + } break; case 'e': @@ -3593,6 +3599,13 @@ end_element_handler (GMarkupParseContext *context, if (ctx->unknown_depth == 0) state_switch (ctx, ctx->prev_state); break; + + case STATE_DOC_FORMAT: + if (require_end_element (context, ctx, "doc:format", element_name, error)) + { + state_switch (ctx, STATE_REPOSITORY); + } + break; default: g_error ("Unhandled state %d in end_element_handler\n", ctx->state); } -- cgit v1.2.1