removing indented blocks from markdown

This commit is contained in:
Abubakar Abid 2022-04-01 17:11:44 -07:00
parent e5ea806b5e
commit 983535ca50
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,6 @@
from __future__ import annotations
import inspect
import json
import math
import numbers
@ -2789,7 +2790,8 @@ class Markdown(Component):
"""
super().__init__(label=label, css=css, **kwargs)
self.md = MarkdownIt()
self.default_value = self.md.render(default_value)
unindented_default_value = inspect.cleandoc(default_value)
self.default_value = self.md.render(unindented_default_value)
def get_template_context(self):
return {"default_value": self.default_value, **super().get_template_context()}

View File

@ -45,7 +45,7 @@
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
<title>Gradio</title>
<script type="module" crossorigin src="./assets/index.6ccb5958.js"></script>
<script type="module" crossorigin src="./assets/index.ca2ada27.js"></script>
<link rel="modulepreload" href="./assets/vendor.c988cbcf.js">
<link rel="stylesheet" href="./assets/index.cdf32a5f.css">
</head>