mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-06 12:30:29 +08:00
Chatbot LaTeX Crash Fix (#8658)
* latex fix * format * add changeset * fix demo (#8696) * Better spacing for codeblocks on docs (#8686) * styling for codeblocks * add changeset * formatting * add changeset * changes --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Add search to website (#8624) * Update action.yml (#8702) * Model3D point cloud and wireframe display modes (#8687) * display modes * add changeset * test fixes * lint * Update gradio/components/model3d.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * solid --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Fix playground to display errors (#8689) * Fix the Playground on the website to trigger run_code() and install() with debounce and to display errors * Remove an unused function, make_full_screen() * Format demo/hello_world/run.py * Update notebook * add changeset * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> * GRADIO_ALLOWED_PATHS & GRADIO_BLOCKED_PATHS comma separated environme… (#8705) * GRADIO_ALLOWED_PATHS & GRADIO_BLOCKED_PATHS comma separated environment variables * GRADIO_ALLOWED_PATHS & GRADIO_BLOCKED_PATHS comma separated environment variables * add changeset * Document GRADIO_ALLOWED_PATHS and GRADIO_BLOCKED_PATHS --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Ensure JS client `status_callback` functionality works and improve status messages (#8699) * * bind handle_space_success * ensure status callbacks work correctly * add changeset * test fixes + refactor * tweak * test * Revert "test" This reverts commit db1afc40b4510fd3d2b805b49f334eb4e5ca3e47. --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> * Documents auth in the guides, in the view API page, and also types the Blocks.config object (#8720) * auth docs * changes * add changeset * add changeset * add changeset * type * changes * snippets * import * add changeset * changes * fix typing --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> * remove on mount * merge * remove onmount --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com> Co-authored-by: cocktailpeanut <121128867+cocktailpeanut@users.noreply.github.com> Co-authored-by: Hannah <hannahblair@users.noreply.github.com>
This commit is contained in:
parent
3a6142fa48
commit
0482453fd5
6
.changeset/puny-dolls-work.md
Normal file
6
.changeset/puny-dolls-work.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"@gradio/markdown": patch
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:Chatbot LaTeX Crash Fix
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { afterUpdate, createEventDispatcher } from "svelte";
|
||||
import { afterUpdate } from "svelte";
|
||||
import DOMPurify from "dompurify";
|
||||
import render_math_in_element from "katex/contrib/auto-render";
|
||||
import "katex/dist/katex.min.css";
|
||||
@ -73,15 +73,18 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
afterUpdate(() => render_html(message));
|
||||
|
||||
afterUpdate(async () => {
|
||||
if (el && document.body.contains(el)) {
|
||||
await render_html(message);
|
||||
} else {
|
||||
console.error("Element is not in the DOM");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<span class:chatbot bind:this={el} class="md" class:prose={render_markdown}>
|
||||
{#if render_markdown}
|
||||
{@html html}
|
||||
{:else}
|
||||
{html}
|
||||
{/if}
|
||||
{@html html}
|
||||
</span>
|
||||
|
||||
<style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user