mishig HF staff commited on
Commit
db8bde2
1 Parent(s): f9b7714

fix share btn search params

Browse files
Files changed (1) hide show
  1. share_btn.py +6 -3
share_btn.py CHANGED
@@ -67,12 +67,15 @@ ${inputTxt}
67
 
68
  ${outputTxt}`;
69
 
70
- const params = new URLSearchParams({
71
  title: titleTxt,
72
  description: descriptionMd,
73
- });
 
 
 
 
74
 
75
- const paramsStr = params.toString();
76
  window.open(`https://huggingface.co/spaces/trl-lib/stack-llama/discussions/new?${paramsStr}`, '_blank');
77
 
78
  shareBtnEl.style.removeProperty('pointer-events');
 
67
 
68
  ${outputTxt}`;
69
 
70
+ const params = {
71
  title: titleTxt,
72
  description: descriptionMd,
73
+ };
74
+
75
+ const paramsStr = Object.entries(params)
76
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
77
+ .join('&');
78
 
 
79
  window.open(`https://huggingface.co/spaces/trl-lib/stack-llama/discussions/new?${paramsStr}`, '_blank');
80
 
81
  shareBtnEl.style.removeProperty('pointer-events');