mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-18 10:44:33 +08:00
removing indented blocks from markdown
This commit is contained in:
parent
e5ea806b5e
commit
983535ca50
@ -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()}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user