Skip to content

Commit 80ba9f7

Browse files
committed
test: add smoke test for PDF MIME priority fix (#13582)
Pre-rendered .ipynb with both application/pdf and image/svg+xml outputs. Renders to latex format with use-rsvg-convert: false and verifies that \includegraphics with .pdf is used (not \includesvg).
1 parent 26a9671 commit 80ba9f7

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"metadata": {
3+
"kernelspec": {
4+
"display_name": "Python 3",
5+
"language": "python",
6+
"name": "python3"
7+
},
8+
"language_info": {
9+
"name": "python",
10+
"version": "3.10.0"
11+
}
12+
},
13+
"nbformat": 4,
14+
"nbformat_minor": 5,
15+
"cells": [
16+
{
17+
"id": "1",
18+
"cell_type": "raw",
19+
"metadata": {},
20+
"source": [
21+
"---\n",
22+
"title: \"Issue 13582: PDF MIME priority for LaTeX\"\n",
23+
"format: latex\n",
24+
"use-rsvg-convert: false\n",
25+
"execute:\n",
26+
" enabled: false\n",
27+
"_quarto:\n",
28+
" tests:\n",
29+
" latex:\n",
30+
" ensureFileRegexMatches:\n",
31+
" - [\"\\\\\\\\includegraphics[^\\\\n]*\\\\.pdf\"]\n",
32+
" - [\"\\\\\\\\includesvg\"]\n",
33+
"---\n"
34+
]
35+
},
36+
{
37+
"id": "2",
38+
"cell_type": "code",
39+
"metadata": {},
40+
"source": [
41+
"# Synthetic cell: outputs contain both application/pdf and image/svg+xml.\n",
42+
"# With the fix, application/pdf should be preferred for LaTeX output."
43+
],
44+
"outputs": [
45+
{
46+
"output_type": "execute_result",
47+
"execution_count": 1,
48+
"data": {
49+
"application/pdf": "JVBERi0xLjAKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbMyAwIFJdL0NvdW50IDE+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL01lZGlhQm94WzAgMCAxMDAgMTAwXS9QYXJlbnQgMiAwIFI+PmVuZG9iagp4cmVmCjAgNAowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDkgMDAwMDAgbiAKMDAwMDAwMDA1OCAwMDAwMCBuIAowMDAwMDAwMTE1IDAwMDAwIG4gCnRyYWlsZXI8PC9TaXplIDQvUm9vdCAxIDAgUj4+CnN0YXJ0eHJlZgoxOTAKJSVFT0Y=",
50+
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\">\n<rect fill=\"red\" width=\"100\" height=\"100\"/>\n</svg>"
51+
},
52+
"metadata": {}
53+
}
54+
],
55+
"execution_count": 1
56+
}
57+
]
58+
}

0 commit comments

Comments
 (0)