(pattern)
return html
Returns the content of a file matched by the pattern.
    Returns an error message if the pattern cannot be found.
Returns the content of a file matched by the pattern.
    Returns an error message if the pattern cannot be found.
Returns the content of a file matched by the pattern . Returns an error message if the pattern cannot be found .
def markdown_file(pattern):
    """
    Returns the content of a file matched by the pattern.
    Returns an error message if the pattern cannot be found.
    """
    path = pattern
    path = os.path.abspath(path)
    if os.path.isfile(path):
        text = open(path).read()
    else:
        text = f" file '{pattern}': '{path}' not found"

    try:

        html = markdown.parse(text, clean=False, escape=False, allow_rewrite=True)
        html = bleach.linkify(html, callbacks=[top_level_only], skip_tags=['pre'])
        html = mark_safe(html)
    except Exception as e:
        html = f"Markdown rendering exception"
        logger.error(e)
    return html
def markdown_file ( pattern ) : path = pattern path = os . path . abspath ( path ) if os . path . isfile ( path ) : text = open ( path ) . read ( ) else : text = f" file '{pattern}': '{path}' not found" try : html = markdown . parse ( text , clean = False , escape = False , allow_rewrite = True ) html = bleach . linkify ( html , callbacks = [ top_level_only ] , skip_tags = [ 'pre' ] ) html = mark_safe ( html ) except Exception as e : html = f"Markdown rendering exception" logger . error ( e ) return html