|
@@ -33,17 +33,17 @@ export default class Comment extends React.Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
componentWillMount() {
|
|
componentWillMount() {
|
|
|
- this.renderHtml(this.props.comment.comment, this.props.highlightKeywords);
|
|
|
|
|
|
|
+ this.renderHtml(this.props.comment.comment);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
componentWillReceiveProps(nextProps) {
|
|
|
- this.renderHtml(nextProps.comment.comment, nextProps.highlightKeywords);
|
|
|
|
|
|
|
+ this.renderHtml(nextProps.comment.comment);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//not used
|
|
//not used
|
|
|
setMarkdown(markdown) {
|
|
setMarkdown(markdown) {
|
|
|
this.setState({ markdown });
|
|
this.setState({ markdown });
|
|
|
- this.renderHtml(markdown, this.props.highlightKeywords);
|
|
|
|
|
|
|
+ this.renderHtml(markdown);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
isCurrentUserEqualsToAuthor() {
|
|
isCurrentUserEqualsToAuthor() {
|
|
@@ -79,11 +79,10 @@ export default class Comment extends React.Component {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- renderHtml(markdown, highlightKeywords) {
|
|
|
|
|
|
|
+ renderHtml(markdown) {
|
|
|
var context = {
|
|
var context = {
|
|
|
markdown,
|
|
markdown,
|
|
|
dom: this.revisionBodyElement,
|
|
dom: this.revisionBodyElement,
|
|
|
- currentPagePath: this.props.pagePath,
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const crowiRenderer = this.props.crowiRenderer;
|
|
const crowiRenderer = this.props.crowiRenderer;
|
|
@@ -101,11 +100,6 @@ export default class Comment extends React.Component {
|
|
|
.then(() => interceptorManager.process('preCommentPostProcess', context))
|
|
.then(() => interceptorManager.process('preCommentPostProcess', context))
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
context.parsedHTML = crowiRenderer.postProcess(context.parsedHTML, context.dom);
|
|
context.parsedHTML = crowiRenderer.postProcess(context.parsedHTML, context.dom);
|
|
|
-
|
|
|
|
|
- // highlight
|
|
|
|
|
- if (highlightKeywords != null) {
|
|
|
|
|
- context.parsedHTML = this.getHighlightedBody(context.parsedHTML, highlightKeywords);
|
|
|
|
|
- }
|
|
|
|
|
})
|
|
})
|
|
|
.then(() => interceptorManager.process('postCommentPostProcess', context))
|
|
.then(() => interceptorManager.process('postCommentPostProcess', context))
|
|
|
.then(() => interceptorManager.process('preCommentRenderHtml', context))
|
|
.then(() => interceptorManager.process('preCommentRenderHtml', context))
|
|
@@ -162,6 +156,4 @@ Comment.propTypes = {
|
|
|
deleteBtnClicked: PropTypes.func.isRequired,
|
|
deleteBtnClicked: PropTypes.func.isRequired,
|
|
|
crowi: PropTypes.object.isRequired,
|
|
crowi: PropTypes.object.isRequired,
|
|
|
crowiRenderer: PropTypes.object.isRequired,
|
|
crowiRenderer: PropTypes.object.isRequired,
|
|
|
- pagePath: PropTypes.string.isRequired,
|
|
|
|
|
- highlightKeywords: PropTypes.string,
|
|
|
|
|
};
|
|
};
|