import { Gridicon, EmbedContainer } from '@automattic/components'; import DOMPurify from 'dompurify'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; import { Component } from 'react'; import { connect } from 'react-redux'; import AutoDirection from 'calypso/components/auto-direction'; import QueryComment from 'calypso/components/data/query-comment'; import { stripHTML, decodeEntities } from 'calypso/lib/formatting'; import CommentLink from 'calypso/my-sites/comments/comment/comment-link'; import CommentPostLink from 'calypso/my-sites/comments/comment/comment-post-link'; import { getParentComment, getSiteComment } from 'calypso/state/comments/selectors'; import { getSelectedSiteId, getSelectedSiteSlug } from 'calypso/state/ui/selectors'; import { hasBlocks } from './utils'; export class CommentContent extends Component { static propTypes = { commentId: PropTypes.number, isBulkMode: PropTypes.bool, isPostView: PropTypes.bool, }; state = { // Cache whether the comment has blocks. We don't want change that mid-typing (in case the user adds `