confluence-md-sync 0.8.9 → 0.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/export/to-markdown.js +32 -4
- package/package.json +1 -1
|
@@ -147,10 +147,38 @@ class Converter {
|
|
|
147
147
|
// tables:'records' — любую таблицу разворачиваем в записи.
|
|
148
148
|
if (this.tablesAsRecords)
|
|
149
149
|
return this.recordsTable(el);
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
try {
|
|
151
|
+
return this.tableToMd(el);
|
|
152
|
+
}
|
|
153
|
+
catch (e) {
|
|
154
|
+
if (!(e instanceof Unrepresentable))
|
|
155
|
+
throw e;
|
|
156
|
+
// Строгая GFM-конвертация отклонила таблицу: то ли из-за косметики
|
|
157
|
+
// (Confluence лепит class="wrapped" style="width:…%" на КАЖДУЮ
|
|
158
|
+
// таблицу, а первую строку часто оформляет жирным <td> вместо <th>),
|
|
159
|
+
// то ли из-за реальных объединений (colspan/rowspan). В faithful без
|
|
160
|
+
// этой ветки ЛЮБАЯ такая таблица падала в дословный <table> HTML —
|
|
161
|
+
// нормализуем в GFM тем же путём, что readable (buildTableGrid не
|
|
162
|
+
// смотрит на атрибуты/семантику заголовка): оформление и объединения
|
|
163
|
+
// теряются при повторной публикации, но данные — md-таблица, не теги.
|
|
164
|
+
if (!this.readable) {
|
|
165
|
+
const saved = this.readable;
|
|
166
|
+
this.readable = true;
|
|
167
|
+
try {
|
|
168
|
+
const norm = this.readableTable(el);
|
|
169
|
+
this.stats.normalized++;
|
|
170
|
+
return norm;
|
|
171
|
+
}
|
|
172
|
+
catch (e2) {
|
|
173
|
+
if (!(e2 instanceof Unrepresentable))
|
|
174
|
+
throw e2;
|
|
175
|
+
}
|
|
176
|
+
finally {
|
|
177
|
+
this.readable = saved;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
throw e;
|
|
181
|
+
}
|
|
154
182
|
}
|
|
155
183
|
if (el.name === 'ac:structured-macro')
|
|
156
184
|
return this.macroToMd(el);
|
package/package.json
CHANGED