AI Demos Research — the structured-intelligence platform. Every verdict on these pages opens to the execution behind it.
Graded 12 November 2026

Does Upstage AI preserve code blocks and their indentation when converting a PDF to Markdown?

Upstage AI did not preserve code-block formatting when converting the PDF to Markdown. Its output kept the code's characters and line breaks, but lost indentation and treated the code as ordinary paragraphs.

1 of 1 test case failed

Every test case in this scenario has a result.

Pass rate0%0 of 1 gradable
Coverage1 of 1test case with a result
0PassNo test case passed.
1FailMissed at least one thing it was expected to do; the reason and proof are with each test case below.
0Not gradableEvery result here could be graded.
0UntestedEvery test case in this scenario has a result.
The pass rate is a summary. The evidence is the test case below: what we sent, what we checked, what the tool returned, and the proof.

The test case

Each test case is judged on its own: Pass, Fail, Not gradable, or Untested. The scenario result above is based on this test case.

Code block — fenced, structure intactFailEvidence
What we sent

We sent the complete three-page operations-note PDF to Upstage Document Parse's conversion API in one synchronous request, without selecting a parsing mode.

InputDocument (PDF)
Input PDF: boxed Python and shell code with indentation on page 2
Open the PDF ↗
What the tool returned

Copied from Output file (Markdown), lines 50–61

Markdown
from tarnbeck.stations import Export, reload_window

def reload_after_reset(station, reset_at):
export = Export.open(station)
window = reload_window(reset_at, margin_minutes=45)

for block in export.blocks(window):
if block.checksum_ok():
continue
export.requeue(block, reason="gauge reset")

return export.commit(dry_run=False)

Copied from Output file (JSON), elements 18

JSON
{
  "id": 17,
  "page": 2,
  "category": "paragraph",
  "content": {
    "html": "<p id='17' data-category='paragraph' style='font-size:16px'>def reload_after_reset(station, reset_at):<br>export = Export.open(station)<br>window = reload_window(reset_at, margin_minutes=45)</p>",
    "markdown": "def reload_after_reset(station, reset_at):\nexport = Export.open(station)\nwindow = reload_window(reset_at, margin_minutes=45)",
    "text": ""
  },
  "coordinates": [
    {
      "x": 0.1263,
      "y": 0.1428
    },
    {
      "x": 0.592,
      "y": 0.1428
    },
    {
      "x": 0.592,
      "y": 0.1868
    },
    {
      "x": 0.1263,
      "y": 0.1868
    }
  ]
}

Copied from Output file (JSON), elements 19

JSON
{
  "id": 18,
  "page": 2,
  "category": "paragraph",
  "content": {
    "html": "<p id='18' data-category='paragraph' style='font-size:16px'>for block in export.blocks(window):<br>if block.checksum_ok():<br>continue<br>export.requeue(block, reason=&#34;gauge reset&#34;)</p>",
    "markdown": "for block in export.blocks(window):\nif block.checksum_ok():\ncontinue\nexport.requeue(block, reason=\"gauge reset\")",
    "text": ""
  },
  "coordinates": [
    {
      "x": 0.1605,
      "y": 0.2026
    },
    {
      "x": 0.5587,
      "y": 0.2026
    },
    {
      "x": 0.5587,
      "y": 0.2624
    },
    {
      "x": 0.1605,
      "y": 0.2624
    }
  ]
}

Returned Markdown: code lines without fences or indentation

Open the Markdown file ↗

API response: code classified as paragraphs without indentation or fences

Open the whole JSON file ↗
Expected vs. Found
✗Expected: Code must remain a preformatted or fenced block, with its line breaks and indentation intact.Found: Code became paragraphs without fences or preformatted markup. The source's 4-, 8- and 12-space indents disappeared; characters and line breaks survived.
Supporting proof
Proof 1Screenshot
Comparison image: page 2 code beside Markdown extending through the next page's heading
Open original ↗
Proof 2Screenshot
Run details card: the complete PDF request, default pipeline and completed conversion
Open original ↗
Proof 3Screenshot
Comparison image: page 2's indented code beside a shorter, left-aligned Markdown excerpt
Open original ↗
Cited values2 values from this file
usage
{ "pages": 3, "standard": [1, 2, 3] }
elements 25
{ "id": 24, "page": 2, "category": "paragraph", "content": { "html": "<p id='24' data-category='paragraph' style='font-size:16px'>$ ssh loader-01.tarnbeck.example<br>$ tarnbeck-maint reload-after-reset --station VQ1 \\<br>--reset-at '2026-01-29T09:15' --confirm</p>", "markdown": "$ ssh loader-01.tarnbeck.example\n$ tarnbeck-maint reload-after-reset --station VQ1 \\\n--reset-at '2026-01-29T09:15' --confirm", "text": "" }, "coordinates": [ { "x": 0.1238, "y": 0.5482 }, { "x": 0.5599, "y": 0.5482 }, { "x": 0.5599, "y": 0.5927 }, { "x": 0.1238, "y": 0.5927 } ] }
Why this result

Preserving the code's text was not enough: its block formatting and indentation also had to survive. Returning it as ordinary paragraphs left both required features absent.

Also observed in this test case

Heading formatting survived. The returned heading "If the count is short" retained Markdown heading syntax, so the loss of code formatting did not affect all Markdown markup.

Tested by Chandresh Bisht · evidence dated 9 September 2026

Configuration and setup

How this tool was set up for the run and what the test needed in place. Each row is a fact from the run's records; a fact the records do not hold is left out, not guessed.

Software that produced the output
Upstage AI
Build or version
document-parse-260630 (API 2.0)
Plan or tier
free tier
Surface
API
Set up before the run
The operations-note PDF with indented Python and shell code had to be converted in full to Markdown, in one pass using the default pipeline without per-product tuning.
Conversion
default pipeline, synchronous endpoint · one pass, no parsing mode selected
Tested
9 September 2026 · Chandresh Bisht

How this scenario is graded

How we decide Pass, Fail and Not gradable. The same rules apply to every tool tested on this scenario.

How results are decided

Each test case gets one result per tool: Pass, Fail or Not gradable. A test case we haven't run yet shows Untested. There are no partial results.

The rules
  • Pass: the tool did everything the test expected, and nothing it said contradicts the correct answer.
  • Fail: at least one expected behaviour clearly didn't happen; the test case's result says which one and quotes the tool.
  • Not gradable: our evidence couldn't settle the outcome (for example a record we needed is missing). It is never counted as a fail, and the test case's result says what's missing.

Where this sits in the benchmark

This page is one cell of a larger study: one tool, one scenario. Only this benchmark's frame appears here.

History of this result

What has happened to this result since it was first published. Runs and grades are never overwritten: a retest or a re-grade publishes a new result and keeps the earlier one readable.

from the publication record
18 November 2026First publishedConverting a complex PDF into clean Markdown with a hosted API v1

Act on this result

Nothing filed here edits the run or the grade. A challenge opens a review, and a review can produce a new run or a re-grade — which becomes the current result and leaves this one in the history.

This matches what I see

You run the same kind of test against your own setup and get the same behaviour.

Agree →
This does not match

Yours behaves differently. Tell us what you got, with a screenshot if you have one.

Disagree →
Point out an issue

Something here is wrong — a reference value, a transcription, a grade.

Report an issue →
Request a retest

On a newer build, a larger dataset, or your own setup.

Request a retest →
We have fixed this

Tell us what changed and we schedule a rerun of the failing test case. The old result stays as history.

Vendor notice →
Filed against this evidenceNothing yet. Challenges, counter-evidence and fix notices appear here with their outcome, and stay on the page after they are resolved.
Cite this result
aidemos.com/benchmarks/pdf-to-markdown-apis/results/upstage-ai/a-document-containing-a-code-block · 0 pass · 1 fail · coverage 1/1 · graded 2026-11-12

The same record is available as structured data through the AI Demos MCP server, with the counts, the coverage and every per-test-case reason carried as fields.

Verify the proof files

These files support this result. Open a file to inspect the original evidence.

Input · Document (PDF) ↗application/pdf · 78 KB
Output file (Markdown) ↗text/markdown · 6 KB
Output file (JSON) ↗application/json · 53 KB
Proof 1 · Screenshot ↗image/png · 516 KB
Proof 2 · Screenshot ↗image/png · 69 KB
Proof 3 · Screenshot ↗image/png · 210 KB
File fingerprints (SHA-256)

A fingerprint identifies the exact file used for this result.

Input · Document (PDF)cd27d1e77ec9818ff769bde1b49d95e711373888507af4b007054c27b7a52db8
Output file (Markdown)f948d2276664341ec30f3079b3ebc55ea255cbea14e1785b9e0530f9a5398406
Output file (JSON)ba1e3edc28e4fd9c943d42b0ace4e9a2449f4509422bca894d50b5f5afe9720e
Proof 1 · Screenshot8a647cce55e7e3463028548998fd88d1386f2746b0bf2de5e1005a4788e0635e
Proof 2 · Screenshot3c46efe4fdb2a9b7a139c4d989ad345771d51b063c149df2a280ceb8e10f8067
Proof 3 · Screenshot0dd83cc64db20452f33bd0f644531cbd086b22dfe4c3c2427a4ad2fd00f805a7