pdit 0.4.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pdit-0.4.0/pdit.egg-info → pdit-0.5.0}/PKG-INFO +1 -1
- {pdit-0.4.0 → pdit-0.5.0}/pdit/ipython_executor.py +3 -1
- {pdit-0.4.0 → pdit-0.5.0/pdit.egg-info}/PKG-INFO +1 -1
- {pdit-0.4.0 → pdit-0.5.0}/pyproject.toml +1 -1
- {pdit-0.4.0 → pdit-0.5.0}/tests/test_ipython_executor.py +9 -0
- {pdit-0.4.0 → pdit-0.5.0}/LICENSE +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/MANIFEST.in +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/README.md +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit/__init__.py +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit/_demo.py +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit/_static/assets/index-1w8kifoA.js +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit/_static/assets/index-rS96z8hq.css +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit/_static/export.html +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit/_static/index.html +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit/cli.py +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit/exporter.py +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit/file_watcher.py +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit/server.py +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit.egg-info/SOURCES.txt +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit.egg-info/dependency_links.txt +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit.egg-info/entry_points.txt +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit.egg-info/requires.txt +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/pdit.egg-info/top_level.txt +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/setup.cfg +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/tests/test_file_watcher.py +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/tests/test_local_import.py +0 -0
- {pdit-0.4.0 → pdit-0.5.0}/tests/test_server.py +0 -0
|
@@ -197,7 +197,7 @@ del _register_pdit_runtime_hooks
|
|
|
197
197
|
"""Process MIME bundle data into output dicts.
|
|
198
198
|
|
|
199
199
|
Passes through MIME types directly instead of translating to custom types.
|
|
200
|
-
Uses priority order: image > html > json > plain text.
|
|
200
|
+
Uses priority order: image > html > markdown > json > plain text.
|
|
201
201
|
"""
|
|
202
202
|
output: list[dict] = []
|
|
203
203
|
|
|
@@ -210,6 +210,8 @@ del _register_pdit_runtime_hooks
|
|
|
210
210
|
output.append({"type": mime_type, "content": data[mime_type]})
|
|
211
211
|
elif 'text/html' in data:
|
|
212
212
|
output.append({"type": "text/html", "content": data['text/html']})
|
|
213
|
+
elif 'text/markdown' in data:
|
|
214
|
+
output.append({"type": "text/markdown", "content": data['text/markdown']})
|
|
213
215
|
elif 'application/json' in data:
|
|
214
216
|
json_data = data['application/json']
|
|
215
217
|
output.append({"type": "application/json", "content": json.dumps(json_data)})
|
|
@@ -361,6 +361,15 @@ class TestMimeTypeProcessing:
|
|
|
361
361
|
result = results[1]
|
|
362
362
|
assert result["output"][0]["type"] == "text/plain"
|
|
363
363
|
|
|
364
|
+
async def test_ipython_display_markdown(self, executor):
|
|
365
|
+
"""Test IPython.display.Markdown renders as text/markdown."""
|
|
366
|
+
script = 'from IPython.display import Markdown\nMarkdown("# Hej")'
|
|
367
|
+
results = await collect_results(executor.execute_script(script))
|
|
368
|
+
|
|
369
|
+
result = results[-1]
|
|
370
|
+
assert result["output"][0]["type"] == "text/markdown"
|
|
371
|
+
assert "# Hej" in result["output"][0]["content"]
|
|
372
|
+
|
|
364
373
|
async def test_none_result(self, executor):
|
|
365
374
|
"""Test that None results produce no output."""
|
|
366
375
|
script = "None"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|