gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
32.24k stars 2.41k forks source link

Markdown Formatting In gr.Dataset Lost After Update #4171

Closed jeffthebear closed 1 year ago

jeffthebear commented 1 year ago

Describe the bug

We start with a gr.Dataset with the components=['markdown'] and samples set but after an event that updates the samples in the dataset the display looks like it lost the markdown formatting and is formatted as if components=['text'].

Is there an existing issue for this?

Reproduction

import gradio as gr

data = [['hello\nmd']]

def btn_click(): return [['changed to\nnot md']]

with gr.Blocks() as demo: with gr.Row(): dataset = gr.Dataset(components=['markdown'], type='index', samples=data, label='Results') btn = gr.Button("btn")

btn.click(fn=btn_click, inputs=[], outputs=[dataset])

demo.launch()

Screenshot

before_click after_click

Logs

No error in stacktrace, it is seen in the UI.

System Info

gradio: 3.29.0
os: MAC OS 13.3.1
browser: Chrome Version 113.0.5672.63

Severity

annoying

abidlabs commented 1 year ago

Same as #4509. I'll close this issue as that one has an easier to follow repro.