raannakasturi commited on
Commit
50c7854
·
1 Parent(s): aea389a

Refactor mindmap SVG generation in post_blog.py for improved string concatenation and result handling

Browse files
Files changed (1) hide show
  1. post_blog.py +2 -2
post_blog.py CHANGED
@@ -15,13 +15,13 @@ blog_id = os.getenv('BLOG_ID')
15
  imgbb_api_key = os.getenv('IMGBB_API_KEY')
16
 
17
  def generate_mindmap_svg(title, mindmap):
18
- data = "# ",title , "\n" , mindmap
19
  client = Client("raannakasturi/MarkdownToSVG")
20
  result = client.predict(
21
  markdown_text=data,
22
  api_name="/markdown_svg_generator"
23
  )
24
- return result.strip("https:")
25
 
26
  def generate_post_html(title, summary, mindmap, citation):
27
  title = title.replace("{", r'{').replace("}", r'}')
 
15
  imgbb_api_key = os.getenv('IMGBB_API_KEY')
16
 
17
  def generate_mindmap_svg(title, mindmap):
18
+ data = "# " + title + "\n" + mindmap
19
  client = Client("raannakasturi/MarkdownToSVG")
20
  result = client.predict(
21
  markdown_text=data,
22
  api_name="/markdown_svg_generator"
23
  )
24
+ return result.strip()
25
 
26
  def generate_post_html(title, summary, mindmap, citation):
27
  title = title.replace("{", r'{').replace("}", r'}')