Skip to content

Commit

Permalink
fix: broken converted list in table (fix #1119) (#1120)
Browse files Browse the repository at this point in the history
* fix: broken converted list in table (fix #1119)

* fix: edit unit test
  • Loading branch information
seonim-ryu authored Jul 23, 2020
1 parent ba39eb8 commit e3cd805
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions apps/editor/src/js/wwListManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,7 @@ class WwListManager {

_insertDataToMarkPassForListInTable(html) {
const replacedHtml = html.replace(FIND_CELL_TAG_RX, (match, tdStart, tdContent, tdEnd) => {
const content = tdContent.replace(
FIND_LIST_OR_LIST_ITEM_TAG_RX,
'<$1 data-tomark-pass="" $2>'
);
const content = tdContent.replace(FIND_LIST_OR_LIST_ITEM_TAG_RX, '<$1 data-tomark-pass $2>');

return `${tdStart}${content}${tdEnd}`;
});
Expand Down
8 changes: 4 additions & 4 deletions apps/editor/test/unit/wwListManager.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,14 @@ describe('WwListManager', () => {

const expectedHtml = [
'<table><thead><tr><th>',
'<ul data-tomark-pass="" ><li data-tomark-pass="" >123<br></li></ul>',
'<ul data-tomark-pass ><li data-tomark-pass >123<br></li></ul>',
'456<br>',
'<ol data-tomark-pass="" ><li data-tomark-pass="" >789<br></li></ol>',
'<ol data-tomark-pass ><li data-tomark-pass >789<br></li></ol>',
'</th></tr></thead>',
'<tbody><tr><td>',
'<ul data-tomark-pass="" ><li data-tomark-pass="" >123<br></li></ul>',
'<ul data-tomark-pass ><li data-tomark-pass >123<br></li></ul>',
'456<br>',
'<ol data-tomark-pass="" ><li data-tomark-pass="" >789<br></li></ol>',
'<ol data-tomark-pass ><li data-tomark-pass >789<br></li></ol>',
'</td></tr></tbody></table>'
].join('');

Expand Down

0 comments on commit e3cd805

Please sign in to comment.