MCPcopy
hub / github.com/showlab/Code2Video / extract_json_from_markdown

Function extract_json_from_markdown

src/utils.py:11–16  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

9
10
11def extract_json_from_markdown(text):
12 # Match ```json ... ``` or ``` ... ```
13 match = re.search(r"```(?:json)?\s*(\{.*?\})\s*```", text, re.DOTALL)
14 if match:
15 return match.group(1)
16 return text
17
18
19def extract_answer_from_response(response):

Callers 3

generate_outlineMethod · 0.85
generate_storyboardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected