mishig HF staff commited on
Commit
47b158f
1 Parent(s): 2666da2

fix share btn

Browse files
Files changed (1) hide show
  1. share_btn.py +2 -1
share_btn.py CHANGED
@@ -40,7 +40,8 @@ share_js = """async () => {
40
  // const gradioEl = document.querySelector('body > gradio-app');
41
  const gradioEl = document.querySelector("gradio-app");
42
  const inputTxt = gradioEl.querySelector('#q-input textarea').value;
43
- const outputTxt = gradioEl.querySelector('#q-output .codemirror-wrapper').outerHTML.replace(`class="cm-gutters"`, `class="cm-gutters hidden"`);
 
44
 
45
  const titleLength = 150;
46
  let titleTxt = inputTxt;
 
40
  // const gradioEl = document.querySelector('body > gradio-app');
41
  const gradioEl = document.querySelector("gradio-app");
42
  const inputTxt = gradioEl.querySelector('#q-input textarea').value;
43
+ let outputTxt = gradioEl.querySelector('#q-output .codemirror-wrapper .cm-scroller > div:nth-of-type(2)').innerText;
44
+ outputTxt = `<pre>${outputTxt}</pre>`
45
 
46
  const titleLength = 150;
47
  let titleTxt = inputTxt;