简体   繁体   English

从命令行输入获取完整的iframe网址,并从python变量解析为HTML

[英]Get full iframe url from command line input and parse as HTML from python variable

I can get the user to input their Google Doc iframe URL and save that as a python variable. 我可以让用户输入他们的Google Doc iframe URL并将其另存为python变量。 When I try to display that variable in HTML with blocking, I just get the html displayed as text on the page. 当我尝试使用阻止功能在HTML中显示该变量时,我只是将html作为文本显示在页面上。 How can I receive the iframe and store it as a Python variable, but then parse it within HTML? 如何接收iframe并将其存储为Python变量,然后在HTML中进行解析? Is this possible? 这可能吗?

Here is what I mean 这就是我的意思

{% block content %}
<div class="iframe-rwd">{{ config.GDOC_RESUME_EMBED_CODE }}</div>
{% endblock %}

Could somebody point me in the right direction to how to solve this? 有人可以指出正确的方向来解决这个问题吗?

Mark the text as safe for interpolation: 将文本标记为可安全插值:

<div class="iframe-rwd">{{ config.GDOC_RESUME_EMBED_CODE|safe }}</div>

See Automatic HTML escaping , or if this is a Jinja2 template, the HTML escaping documentation . 请参阅自动HTML转义 ,或者如果这是Jinja2模板,请参阅HTML转义文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM