Skip to content

Commit

Permalink
feat: Add figcaption to list of non-convertible span parents (#682)
Browse files Browse the repository at this point in the history
Based on this comment: #530 (comment)
  • Loading branch information
johnholdun authored Aug 10, 2022
1 parent de314a9 commit f259d13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/dom/convert-to-paragraphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { DIV_TO_P_BLOCK_TAGS } from './constants';
function convertDivs($) {
$('div').each((index, div) => {
const $div = $(div);
const convertable = $div.children(DIV_TO_P_BLOCK_TAGS).length === 0;
const convertible = $div.children(DIV_TO_P_BLOCK_TAGS).length === 0;

if (convertable) {
if (convertible) {
convertNodeTo($div, $, 'p');
}
});
Expand All @@ -18,8 +18,8 @@ function convertDivs($) {
function convertSpans($) {
$('span').each((index, span) => {
const $span = $(span);
const convertable = $span.parents('p, div, li').length === 0;
if (convertable) {
const convertible = $span.parents('p, div, li, figcaption').length === 0;
if (convertible) {
convertNodeTo($span, $, 'p');
}
});
Expand Down

0 comments on commit f259d13

Please sign in to comment.