This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Helper function to create markdown fenced code blocks robustly | |
def _create_fenced_block(content, language_hint=""): | |
if content is None: | |
content = "" # Ensure content is not None | |
content_str = str(content) # Ensure content is a string | |
fence_char = '`' | |
# Find the longest run of backticks in the content. | |
# Use one more than that for the fence, with a minimum of 3. |