Доброго всем дня.
Есть файл html с таким содержимым:
В этом файле необходимо подставить значение переменной NAME. Раньше все это делал с помощью .format(name=значение), но теперь появилась шапка с описанием стилей, из-за которой появляется ошибка. Какие варианты обхода есть? Я пока придумал только разделить файл на 2, а после подстановки соединять их.
Есть файл html с таким содержимым:
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="format-detection" content="telephone=no">
<style type="text/css" media="screen">
.ExternalClass * {line-height:100%}
@media only screen and (max-width:480px) {
*[id=email-penrose-conteneur] {width:100% !important;}
table[class=resp-full-table] {width:100% !important; clear:both;}
td[class=resp-full-td] {width:100% !important; clear:both;}
td[class=resp-full-td-center] {width:100%!important; clear:both; text-align: center !important;}
.my-clear{padding: 10px 10px !important;}
img[class=email-penrose-img-header] {width:100% !important; max-width:340px !important;}
a[class=resp-punchline] {font-size:30px !important;}
hr[class=resp-hr-center] {text-align: center !important; margin-left:auto !important; margin-right:auto !important;}
td[class=logo_header]{ text-align:center !important;}
td[class=back-header]{background-image: url(http://ipcons2.vrn.ru/updateserver/img/new/10_3_190-139-101_.jpg); background-size: cover !important;}
[class=my-td]{border:none !important;}
}
</style>
</head>
<body bgcolor="#ecf0f1">
{NAME}
<div align="center" style="background-color:#ecf0f1;">
<table id="email-penrose-conteneur" width="660" align="center" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td>
<table width="660" class="resp-full-table" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td class="logo_header" width="100%" style="text-align:left; padding:20px 0px;">
<a href=""><svg height="55px"><image xlink:href="http://ipcons2.vrn.ru/updateserver/img/new/logo.svg" src="http://ipcons2.vrn.ru/updateserver/img/new/logo.png" width="250px"/></svg></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
....
В этом файле необходимо подставить значение переменной NAME. Раньше все это делал с помощью .format(name=значение), но теперь появилась шапка с описанием стилей, из-за которой появляется ошибка. Какие варианты обхода есть? Я пока придумал только разделить файл на 2, а после подстановки соединять их.