Skip to content

Commit

Permalink
Fix the bug where cards with a single paragraph would get nested.
Browse files Browse the repository at this point in the history
Part of #688.
  • Loading branch information
jkomoros committed Apr 8, 2024
1 parent a0b1d12 commit b2089b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/contenteditable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,12 @@ export const exportContentForCards = (cards : ProcessedCard[]) : string => {
for (const child of ele.children) {
if (firstEle) {
parts.push(child.outerHTML);
parts.push('<ul>');
} else {
hasOtherEles = true;
//This is the first non-first element, so add a <ul>.
if (!hasOtherEles) {
parts.push('<ul>');
hasOtherEles = true;
}
parts.push('<li>' + child.outerHTML + '</li>');
}
firstEle = false;
Expand Down

0 comments on commit b2089b2

Please sign in to comment.