Skip to content

Commit c622b59

Browse files
committed
fixes #37
1 parent e45a6fb commit c622b59

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
<!-- do not remove -->
44

5+
## 0.3.1
6+
7+
8+
### Bugs Squashed
9+
10+
- Add edge case tests and fix them ([#36](https://github.com/AnswerDotAI/toolslm/issues/36))
11+
12+
513
## 0.3.0
614

715
### Breaking changes

toolslm/md_hier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def clean_heading(text): return re.sub(r'[.]+', '', text).strip() # Only remove
4747
result[key] = h['content']
4848
return dict2obj(result)
4949

50-
def create_heading_dict(text):
50+
def create_heading_dict(text, rm_fenced=True):
5151
"Create a nested dictionary structure from markdown headings."
52-
text = re.sub(r'```[\s\S]*?```', '', text)
52+
if rm_fenced: text = re.sub(r'```[\s\S]*?```', '', text)
5353
headings = re.findall(r'^#+.*', text, flags=re.MULTILINE)
5454
result = {}
5555
stack = [result]

0 commit comments

Comments
 (0)