Omnibus commited on
Commit
4aa038c
·
verified ·
1 Parent(s): f59ebbe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -551,11 +551,12 @@ def create_image(url):
551
  #out.append("HTML fragments: ")
552
  #q=("a","p","span","content","article")
553
  out=[]
554
- for p in soup.find_all("svg"):
555
- print(p)
556
- out.append(p.string)
 
557
  with open("tmp.svg","w") as svg:
558
- svg.write(out[0])
559
  return "tmp.svg"
560
  def zoom_update(inp):
561
  this.clear()
@@ -596,7 +597,7 @@ with gr.Blocks() as app:
596
  upd_button=gr.Button("Update Chart")
597
  create_im=gr.Button("Create Image")
598
  svg_img=gr.Image()
599
- url_box=gr.Textbox()
600
 
601
  json_out=gr.JSON()
602
  #text=gr.JSON()
 
551
  #out.append("HTML fragments: ")
552
  #q=("a","p","span","content","article")
553
  out=[]
554
+ p = soup.find_all("pre, {'class': 'mermaid'}")
555
+ svg_str = p.find('svg')
556
+ print(svg_str)
557
+ #out.append(p.string)
558
  with open("tmp.svg","w") as svg:
559
+ svg.write(svg_str)
560
  return "tmp.svg"
561
  def zoom_update(inp):
562
  this.clear()
 
597
  upd_button=gr.Button("Update Chart")
598
  create_im=gr.Button("Create Image")
599
  svg_img=gr.Image()
600
+ url_box=gr.Textbox(interactive=True)
601
 
602
  json_out=gr.JSON()
603
  #text=gr.JSON()