Skip to content

Commit f259d13

Browse files
authored
feat: Add figcaption to list of non-convertible span parents (#682)
Based on this comment: #530 (comment)
1 parent de314a9 commit f259d13

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/dom/convert-to-paragraphs.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { DIV_TO_P_BLOCK_TAGS } from './constants';
55
function convertDivs($) {
66
$('div').each((index, div) => {
77
const $div = $(div);
8-
const convertable = $div.children(DIV_TO_P_BLOCK_TAGS).length === 0;
8+
const convertible = $div.children(DIV_TO_P_BLOCK_TAGS).length === 0;
99

10-
if (convertable) {
10+
if (convertible) {
1111
convertNodeTo($div, $, 'p');
1212
}
1313
});
@@ -18,8 +18,8 @@ function convertDivs($) {
1818
function convertSpans($) {
1919
$('span').each((index, span) => {
2020
const $span = $(span);
21-
const convertable = $span.parents('p, div, li').length === 0;
22-
if (convertable) {
21+
const convertible = $span.parents('p, div, li, figcaption').length === 0;
22+
if (convertible) {
2323
convertNodeTo($span, $, 'p');
2424
}
2525
});

0 commit comments

Comments
 (0)