diff --git a/plugins/table-merged-cell/src/js/renderer.js b/plugins/table-merged-cell/src/js/renderer.js index 933385254d..4c8bb6b9a1 100644 --- a/plugins/table-merged-cell/src/js/renderer.js +++ b/plugins/table-merged-cell/src/js/renderer.js @@ -1,3 +1,5 @@ +import encodeHTMLEntity from 'tui-code-snippet/string/encodeHTMLEntity'; + export const renderer = { tableRow(node, { entering, origin }) { if (entering) { @@ -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; diff --git a/plugins/table-merged-cell/src/js/tableRenderer.js b/plugins/table-merged-cell/src/js/tableRenderer.js index 76534d6b39..7e3a559f3d 100644 --- a/plugins/table-merged-cell/src/js/tableRenderer.js +++ b/plugins/table-merged-cell/src/js/tableRenderer.js @@ -2,6 +2,8 @@ * @fileoverview Implements tableRenderer * @author NHN FE Development Lab */ +import encodeHTMLEntity from 'tui-code-snippet/string/encodeHTMLEntity'; + import tableDataHandler from './tableDataHandler'; /** @@ -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}`;