Source code for pyquickhelper.texthelper.html_helper

# -*- coding: utf-8 -*-
"""
Some functions about HTML


:githublink:`%|py|6`
"""
import base64


[docs]def html_in_frame(htext, style="width:100%;height:100%;"): """ Inserts :epkg:`HTML` text into a frame in binary format. :param htext: string to clean :param style: HTML style :return: HTML string :githublink:`%|py|16` """ html = "data:text/html;base64," + base64.b64encode(htext.encode('utf8')).decode('utf8') # noqa return '<iframe src="{html}" style="{style}"></iframe>'.format(html=html, style=style)