Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Markdown footnotes #7880

Open
OnionKiller opened this issue Mar 28, 2024 · 1 comment
Open

Support Markdown footnotes #7880

OnionKiller opened this issue Mar 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@OnionKiller
Copy link

I am trying to use footnotes in Markdown to have references to sources.
It looks like, that the current version of Gradio doesn't supports this extra Markdown feature.

The footnote support could make the creation of big blocks of text with references more beautiful1.

Describe the solution you'd like
The footnote implementation looks failry easy, as marked already has an extension for footnote support:
as mentioned here, marked will not implement it, but this extension

Additional context
The reason why marked didn't implemented it, is UX conserns, and accessibility issues. This may applie here as well, and possibly needs consideration as well.

Footnotes

  1. Hopefully someting similar like this.

@OnionKiller
Copy link
Author

If implemented permanently, then the following implementation would be possible in js/markdown/shared/utils.ts:

import { type Renderer, Marked } from "marked";
import { footnote } from '@marked-extensions/footnote';
...
const marked = new Marked([footnote]);

	marked.use(
		{
			gfm: true,
			pedantic: false,
			breaks: line_breaks
		},

@abidlabs abidlabs added the enhancement New feature or request label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants