()
Import modified CSS code into editor
Import modified CSS code into editor
Import modified CSS code into editor
def profileLoaded():
    """Import modified CSS code into editor"""
    global old_html
    global new_html
    media_dir = mw.col.media.dir()
    css_path = os.path.join(media_dir, "_editor.css")
    if not os.path.isfile(css_path):
        return False
    with open(css_path, "r") as css_file:
        css = css_file.read()
    if not css:
        return False
    editor_style = "<style>\n{}\n</style>".format(css.replace("%","%%"))
    old_html = editor._html
    editor._html = editor._html + editor_style
    new_html = editor._html
def profileLoaded ( ) : global old_html global new_html media_dir = mw . col . media . dir ( ) css_path = os . path . join ( media_dir , "_editor.css" ) if not os . path . isfile ( css_path ) : return False with open ( css_path , "r" ) as css_file : css = css_file . read ( ) if not css : return False editor_style = "<style>\n{}\n</style>" . format ( css . replace ( "%" , "%%" ) ) old_html = editor . _html editor . _html = editor . _html + editor_style new_html = editor . _html