Is it possible to add custom IDs to <figure> tags using the prebuilt-layout model with Markdown output?

Nelson Guamán 40 Reputation points
2025-04-07T14:58:20.2+00:00

Hi everyone,

I'm using Azure Document Intelligence (prebuilt-layout model) in Python and generating Markdown output. Here's the relevant code:

poller = self.client.begin_analyze_document(
    "prebuilt-layout",
    AnalyzeDocumentRequest(bytes_source=file_content),
    output_content_format=DocumentContentFormat.MARKDOWN,
    output=[AnalyzeOutputOption.FIGURES],
)

The generated Markdown includes <figure> tags, but they come without any attributes:

<figure>
...
</figure>

I also have access to the full JSON result, where each figure has an id like "1.1".

Question: Is there a way (via parameters or options in the API) to include an id attribute directly in the <figure> tags in the Markdown output — for example, <figure id="1.1">...</figure>?

Or is manual post-processing the only way to achieve this?

Thanks in advance!

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
2,104 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pavankumar Purilla 8,335 Reputation points Microsoft External Staff Moderator
    2025-04-08T07:41:44.2833333+00:00

    Hi Nelson Guamán

    Currently, the Azure Document Intelligence prebuilt-layout model does not support adding custom id attributes directly to <figure> tags in the Markdown output through any API parameters or options. While the JSON result includes figure IDs (like "1.1"), these IDs are not automatically added to the Markdown. So, the only way to include them is through manual post-processing—after getting the Markdown output, you would need to write a script to go through each <figure> tag and add the corresponding ID from the JSON result.

    It’s very likely that Azure will include this feature in a future update to make the Markdown output more customizable and semantically rich.

    I hope this information helps. Thank you!

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.