File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " gradio " : minor
3
+ " website " : minor
4
+ ---
5
+
6
+ feat: Fix markdown link rendering in docs descriptions
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class LoginButton(Button):
27
27
retrieve a signed-in user's profile by adding a parameter of type `gr.OAuthProfile`
28
28
to any Gradio function. This will only work if this Gradio app is running in a
29
29
Hugging Face Space. Permissions for the OAuth app can be configured in the Spaces
30
- README file, as described here: <a href=" https://huggingface.co/docs/hub/en/spaces-oauth" target="_blank">Spaces OAuth Docs</a> .
30
+ README file, as described here: https://huggingface.co/docs/hub/en/spaces-oauth.
31
31
For local development, instead of OAuth, the local Hugging Face account that is
32
32
logged in (via `hf auth login`) will be available through the `gr.OAuthProfile`
33
33
object.
Original file line number Diff line number Diff line change 1
1
const regex_italic = / \* ( .* ?) \* / g;
2
2
const regex_code = / ` ( .* ?) ` / g;
3
3
const regex_curly_brackets = / \{ ( .* ?) \} / g;
4
+ const regex_auto_links = / \b ( h t t p s ? : \/ \/ \S + ) / g;
4
5
5
6
export function style_formatted_text ( formatted_text : string | null ) : string {
6
7
if ( ! formatted_text ) return "" ;
@@ -15,7 +16,7 @@ export function style_formatted_text(formatted_text: string | null): string {
15
16
"<code class='text-orange-500' style='font-family: monospace; font-size: 0.9em;'>$1</code>"
16
17
)
17
18
. replace (
18
- / \[ ( . * ? ) \] \( ( . * ? ) \) / g ,
19
- "<a href='$2' class= 'text-orange-500'>$1</a>"
19
+ regex_auto_links ,
20
+ "<a href='$1' target='_blank' class= 'text-orange-500'>$1</a>"
20
21
) ;
21
22
}
You can’t perform that action at this time.
0 commit comments