Commit 2ece2a2d authored by chris's avatar chris
Browse files

comment fixes

parent fa8595a1
......@@ -30,7 +30,8 @@ class Exporter extends HTMLExporter {
}
if (
(node.type === 'inline-note' && node.reference === '') ||
node.type === 'find-and-replace'
node.type === 'find-and-replace' ||
node.type === 'resolved-comment'
) {
doc.delete(node.id)
}
......@@ -47,6 +48,7 @@ class Exporter extends HTMLExporter {
el += `</div>`
}
})
console.log('el', el)
return el
}
......@@ -58,9 +60,7 @@ class Exporter extends HTMLExporter {
forEach(content, c => {
string += c.outerHTML
})
el += `<${container.type} id="${container.id}">${string}</${
container.type
}>`
el += `<${container.type} id="${container.id}">${string}</${container.type}>`
})
return el
}
......
......@@ -164,7 +164,7 @@ class CommentsProvider extends AbstractProvider {
// create resolved comment annotation on the same selection the
// comment was on and remove existing comment
es.transaction((tx, args) => {
tx.create(resolvedNodeData)
// tx.create(resolvedNodeData)
newSel = tx.createSelection({
type: 'property',
containerId,
......
import { eq, get, isEmpty, isEqual, groupBy, forEach } from 'lodash'
import { eq, get, isEmpty, isEqual, groupBy, forEach, eachRight } from 'lodash'
import React from 'react'
import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'
......@@ -110,7 +110,6 @@ class Wax extends React.Component {
cleaup(content) {
var wrapper = document.createElement('div')
wrapper.innerHTML = content
//CLEANUP EXCESSIVE EM TAGS
......@@ -128,6 +127,21 @@ class Wax extends React.Component {
}
})
//CLEANUP EXCESSIVE EM TAGS
const comments = wrapper.getElementsByTagName('comment')
forEach(comments, comment => {
const commentReplacer = document.createElement('comment')
if (comment) {
let text = comment.textContent
forEach(comment.childNodes, el => {
if (el.tagName === 'COMMENT') {
const temp = el.textContent
el.replaceWith(temp)
}
})
}
})
//CLEANUP EXCESSIVE TRACK CHANGE TAGS
const trackChanges = wrapper.getElementsByTagName('track-change')
forEach(trackChanges, element => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment