From 17d0f1cad73e21b1ba20c399bf35d809c8625ebe Mon Sep 17 00:00:00 2001 From: Panos Vagenas Date: Mon, 21 Sep 2026 14:32:16 +0200 Subject: [PATCH] allow multiple captions Signed-off-by: Panos Vagenas --- doclang/doclang.xsd | 4 ++-- spec.md | 4 ++-- .../nok_caption_after_description.dclg | 12 ++++++++++ tests/data/valid/ok_caption_multiple.dclg | 22 +++++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 tests/data/invalid/nok_caption_after_description.dclg create mode 100644 tests/data/valid/ok_caption_multiple.dclg diff --git a/doclang/doclang.xsd b/doclang/doclang.xsd index a04e3c7..e3bd6be 100644 --- a/doclang/doclang.xsd +++ b/doclang/doclang.xsd @@ -218,7 +218,7 @@ - + @@ -231,7 +231,7 @@ - + diff --git a/spec.md b/spec.md index 5f23677..9d1f2bb 100644 --- a/spec.md +++ b/spec.md @@ -152,7 +152,7 @@ The XML content of a semantic element begins with an *element head*, which is a - [``](#xref) or [``](#href) (mutually exclusive, optional) - [``](#layer) (optional) - optional sequence of 4 [``](#location)s, whereby values are interpreted in alternating axis order, as `x_min, y_min, x_max, y_max` (after resolution normalization), w.r.t. the top-left corner of the page -- [``](#caption) (optional) +- [``](#caption) (optional, may be repeated) - [``](#description) (optional) - [``](#summary) (optional) - [``](#custom) (optional) @@ -2573,7 +2573,7 @@ None ##### `` -Optional part of the element head for capturing an associated caption. Unlike [``](#description) or [``](#summary), [``](#caption) is an actual document component, which can have its own location information etc. For example, a caption shown underneath a chart. +Optional part of the element head for capturing an associated caption. Unlike [``](#description) or [``](#summary), [``](#caption) is an actual document component, which can have its own location information etc. For example, a caption shown underneath a chart. An element head may contain multiple captions, e.g. a figure with both a title above and a note below, or the same caption in several languages. ###### Allowed Context diff --git a/tests/data/invalid/nok_caption_after_description.dclg b/tests/data/invalid/nok_caption_after_description.dclg new file mode 100644 index 0000000..7b42532 --- /dev/null +++ b/tests/data/invalid/nok_caption_after_description.dclg @@ -0,0 +1,12 @@ + + + + + + FIG. 1. First caption + Derived description of the figure. + FIG. 1. Second caption + + + + diff --git a/tests/data/valid/ok_caption_multiple.dclg b/tests/data/valid/ok_caption_multiple.dclg new file mode 100644 index 0000000..7901647 --- /dev/null +++ b/tests/data/valid/ok_caption_multiple.dclg @@ -0,0 +1,22 @@ + + + + + + FIG. 1. System architecture + Source: internal design review + Block diagram of the system. + Shows the main components. + + + + + + + + + + Value +
Table 1: ResultsTable 1 (cont.)
+ +