Skip to content

Commit

Permalink
fix: broken cell redering with span tag using table-merged-cell plugin (
Browse files Browse the repository at this point in the history
fix #1059)
  • Loading branch information
seonim-ryu committed Jun 24, 2020
1 parent dba0438 commit 8fb6eb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plugins/table-merged-cell/src/js/renderer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import encodeHTMLEntity from 'tui-code-snippet/string/encodeHTMLEntity';

export const renderer = {
tableRow(node, { entering, origin }) {
if (entering) {
Expand Down Expand Up @@ -47,7 +49,7 @@ export const renderer = {
const { attributes = {} } = result;

if (node.orgStringContent) {
attributes['data-org-content'] = node.orgStringContent;
attributes['data-org-content'] = encodeHTMLEntity(node.orgStringContent);
}
if (node.colspan) {
attributes.colspan = node.colspan;
Expand Down
4 changes: 3 additions & 1 deletion plugins/table-merged-cell/src/js/tableRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* @fileoverview Implements tableRenderer
* @author NHN FE Development Lab <dl_javascript@nhn.com>
*/
import encodeHTMLEntity from 'tui-code-snippet/string/encodeHTMLEntity';

import tableDataHandler from './tableDataHandler';

/**
Expand All @@ -27,7 +29,7 @@ function _createCellHtml(cell) {

if (orgContent) {
orgContent += content;
attrs += ` data-org-content="${orgContent}"`;
attrs += ` data-org-content="${encodeHTMLEntity(orgContent)}"`;
}

return `<${nodeName}${attrs}>${content}</${nodeName}>`;
Expand Down

0 comments on commit 8fb6eb1

Please sign in to comment.