RP-Azul commited on
Commit
24a0b74
·
verified ·
1 Parent(s): b28532b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -33,21 +33,21 @@ if uploaded_file and method != "Select a method":
33
  # sections.append(current_section)
34
  # return sections
35
  def parse_markdown_into_boxes(text):
36
- pattern = r'(^#+ .*$)'
37
- parts = re.split(pattern, text, flags=re.MULTILINE)
38
- sections = []
39
 
40
  for i in range(1, len(parts), 2):
41
  header = parts[i].strip()
42
  content = parts[i+1].strip() if i+1 < len(parts) else ""
43
  sections.append({"header": header, "content": content})
44
 
45
- return sections
46
 
47
 
48
- st.subheader("📦 Formatted Output")
49
- for section in parse_markdown_into_boxes(markdown_text):
50
- with st.container(border=True):
51
- if section["header"]:
52
- st.markdown(f"#### {section['header']}")
53
- st.markdown(section["content"])
 
33
  # sections.append(current_section)
34
  # return sections
35
  def parse_markdown_into_boxes(text):
36
+ pattern = r'(^#+ .*$)'
37
+ parts = re.split(pattern, text, flags=re.MULTILINE)
38
+ sections = []
39
 
40
  for i in range(1, len(parts), 2):
41
  header = parts[i].strip()
42
  content = parts[i+1].strip() if i+1 < len(parts) else ""
43
  sections.append({"header": header, "content": content})
44
 
45
+ return sections
46
 
47
 
48
+ st.subheader("📦 Formatted Output")
49
+ for section in parse_markdown_into_boxes(markdown_text):
50
+ with st.container(border=True):
51
+ if section["header"]:
52
+ st.markdown(f"#### {section['header']}")
53
+ st.markdown(section["content"])