mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-18 10:44:33 +08:00
* add support to markdown tables, #1886 * formatting Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
parent
f66c104fc2
commit
b6a56b57b3
@ -2758,7 +2758,7 @@ class Dataframe(Changeable, IOComponent):
|
||||
return data
|
||||
|
||||
if cls.markdown_parser is None:
|
||||
cls.markdown_parser = MarkdownIt()
|
||||
cls.markdown_parser = MarkdownIt().enable("table")
|
||||
|
||||
for i in range(len(data)):
|
||||
for j in range(len(data[i])):
|
||||
@ -4231,7 +4231,7 @@ class Markdown(IOComponent, Changeable):
|
||||
visible: If False, component will be hidden.
|
||||
elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
|
||||
"""
|
||||
self.md = MarkdownIt()
|
||||
self.md = MarkdownIt().enable("table")
|
||||
load_fn, initial_value = self.get_load_fn_and_initial_value(value)
|
||||
self.value = self.postprocess(initial_value)
|
||||
IOComponent.__init__(
|
||||
|
@ -288,14 +288,18 @@ class Interface(Blocks):
|
||||
cleantext = re.sub(CLEANER, "", raw_html)
|
||||
return cleantext
|
||||
|
||||
md = MarkdownIt(
|
||||
"js-default",
|
||||
{
|
||||
"linkify": True,
|
||||
"typographer": True,
|
||||
"html": True,
|
||||
},
|
||||
).use(footnote_plugin)
|
||||
md = (
|
||||
MarkdownIt(
|
||||
"js-default",
|
||||
{
|
||||
"linkify": True,
|
||||
"typographer": True,
|
||||
"html": True,
|
||||
},
|
||||
)
|
||||
.use(footnote_plugin)
|
||||
.enable("table")
|
||||
)
|
||||
|
||||
simple_description = None
|
||||
if description is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user