Replace react-html-parser with html-to-react (#1327)

* Replace react-html-parser with html-to-react

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-06-18 23:26:36 +02:00 committed by GitHub
parent b13c1ce8a0
commit 82472227f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 329 additions and 167 deletions

View file

@ -144,7 +144,7 @@ describe('Autocompletion', () => {
.should('have.text', '# ')
cy.getMarkdownBody()
.find('h1 ')
.should('have.text', ' ')
.should('have.text', '\n ')
})
it('via doubleclick', () => {
cy.codemirrorFill('#')
@ -157,7 +157,7 @@ describe('Autocompletion', () => {
.should('have.text', '# ')
cy.getMarkdownBody()
.find('h1')
.should('have.text', ' ')
.should('have.text', '\n ')
})
})

View file

@ -6,7 +6,7 @@
describe('emojis', () => {
const HEDGEHOG_UNICODE_CHARACTER = '🦔'
const HEDGEHOG_UNICODE_CHARACTER = '\n🦔\n'
beforeEach(() => {
cy.visitTestEditor()

View file

@ -13,16 +13,16 @@ declare namespace Cypress {
}
Cypress.Commands.add('getMarkdownRenderer', () => {
return cy.get(`iframe[data-cy="documentIframe"]`)
.should('be.visible')
.its('0.contentDocument')
.should('exist')
.its('body')
.should('not.be.undefined')
.then(cy.wrap.bind(cy))
return cy
.get(`iframe[data-cy="documentIframe"]`)
.should('be.visible')
.its('0.contentDocument')
.should('exist')
.its('body')
.should('not.be.undefined')
.then(cy.wrap.bind(cy))
})
Cypress.Commands.add('getMarkdownBody', () => {
return cy.getMarkdownRenderer()
.find('.markdown-body')
return cy.getMarkdownRenderer().find('.markdown-body')
})