Kgshop commited on
Commit
cebbd7e
·
verified ·
1 Parent(s): 1f30b7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1072,7 +1072,7 @@ CATALOG_TEMPLATE = '''
1072
  while ((match = productMatchRegex.exec(text)) !== null) {
1073
  if (match.index > lastIndex) {
1074
  const textPart = document.createElement('span');
1075
- textPart.innerHTML = text.substring(lastIndex, match.index).replace(/\\n/g, '<br>');
1076
  contentFragment.appendChild(textPart);
1077
  }
1078
 
@@ -1109,7 +1109,7 @@ CATALOG_TEMPLATE = '''
1109
 
1110
  if (lastIndex < text.length) {
1111
  const textPart = document.createElement('span');
1112
- textPart.innerHTML = text.substring(lastIndex).replace(/\\n/g, '<br>');
1113
  contentFragment.appendChild(textPart);
1114
  }
1115
 
@@ -1237,7 +1237,7 @@ PRODUCT_DETAIL_TEMPLATE = '''
1237
 
1238
  <div style="margin-top: 20px; font-size: 1rem; line-height: 1.7; color: #333; padding: 0 10px;">
1239
  <p><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
1240
- <p><strong>Описание:</strong><br> {{ product.get('description', 'Описание отсутствует.')|replace('\\n', '<br>')|safe }}</p>
1241
  {% set colors = product.get('colors', []) %}
1242
  {% if colors and colors|select('ne', '')|list|length > 0 %}
1243
  <p><strong>Доступные цвета/варианты:</strong> {{ colors|select('ne', '')|join(', ') }}</p>
 
1072
  while ((match = productMatchRegex.exec(text)) !== null) {
1073
  if (match.index > lastIndex) {
1074
  const textPart = document.createElement('span');
1075
+ textPart.innerHTML = text.substring(lastIndex, match.index).replace(/\n/g, '<br>');
1076
  contentFragment.appendChild(textPart);
1077
  }
1078
 
 
1109
 
1110
  if (lastIndex < text.length) {
1111
  const textPart = document.createElement('span');
1112
+ textPart.innerHTML = text.substring(lastIndex).replace(/\n/g, '<br>');
1113
  contentFragment.appendChild(textPart);
1114
  }
1115
 
 
1237
 
1238
  <div style="margin-top: 20px; font-size: 1rem; line-height: 1.7; color: #333; padding: 0 10px;">
1239
  <p><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
1240
+ <p><strong>Описание:</strong><br> {{ product.get('description', 'Описание отсутствует.')|replace('\n', '<br>')|safe }}</p>
1241
  {% set colors = product.get('colors', []) %}
1242
  {% if colors and colors|select('ne', '')|list|length > 0 %}
1243
  <p><strong>Доступные цвета/варианты:</strong> {{ colors|select('ne', '')|join(', ') }}</p>