Skip to content

Commit a15d3e0

Browse files
주석 추가
1 parent a49f3f0 commit a15d3e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llm_utils/display_chart.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ def _extract_python_code(self, markdown_string: str) -> str:
4545
markdown_string = markdown_string.content.split("```")[1][6:].strip()
4646

4747
# Regex pattern to match Python code blocks
48-
pattern = r"```[\w\s]*python\n([\s\S]*?)```|```([\s\S]*?)```"
48+
pattern = r"```[\w\s]*python\n([\s\S]*?)```|```([\s\S]*?)```" # 여러 문자와 공백 뒤에 python이 나오고, 줄바꿈 이후의 모든 내용
4949

5050
# Find all matches in the markdown string
51-
matches = re.findall(pattern, markdown_string, re.IGNORECASE)
51+
matches = re.findall(
52+
pattern, markdown_string, re.IGNORECASE
53+
) # 대소문자 구분 안함
5254

5355
# Extract the Python code from the matches
5456
python_code = []

0 commit comments

Comments
 (0)