diff --git a/cypress/e2e/sections.spec.js b/cypress/e2e/sections.spec.js index c26161ebc03..cc486bb73fa 100644 --- a/cypress/e2e/sections.spec.js +++ b/cypress/e2e/sections.spec.js @@ -52,7 +52,7 @@ describe('Content Sections', () => { cy.openFile(fileName, { force: true }) cy.getContent().type('# Heading 1{enter}') cy.getContent() - .find('h1') + .find('h1 > a') .should('have.attr', 'id') .and('equal', 'h-heading-1') cy.getContent() @@ -61,7 +61,7 @@ describe('Content Sections', () => { .and('equal', '#h-heading-1') cy.getContent().type('{backspace}{backspace}2{enter}') cy.getContent() - .find('h1') + .find('h1 > a') .should('have.attr', 'id') .and('equal', 'h-heading-2') cy.getContent() @@ -75,13 +75,13 @@ describe('Content Sections', () => { cy.visitTestFolder() cy.openFile('anchors.md') cy.getContent() - .get('h2[id="h-bottom"]') + .get('h2 > a[id="h-bottom"]') .should('not.be.inViewport') cy.getContent() .find('a[href="#h-bottom"]:not(.heading-anchor)') .click() cy.getContent() - .get('h2[id="h-bottom"]') + .get('h2 > a[id="h-bottom"]') .should('be.inViewport') }) @@ -92,15 +92,15 @@ describe('Content Sections', () => { cy.getContent() .type('# Heading 1{enter}') cy.getContent() - .find('h1') + .find('h1 > a') .should('have.attr', 'id') .and('equal', 'h-heading-1') cy.getContent() - .find('h1 [data-node-view-content]') + .find('h1') .click({ force: true, position: 'center' }) cy.getActionEntry('headings').click() cy.get('.v-popper__wrapper .open').getActionEntry('headings-h3').click() - cy.getContent().find('h3') + cy.getContent().find('h3 > a') .should('have.attr', 'id') .and('equal', 'h-heading-1') }) diff --git a/src/components/Editor/TableOfContents.vue b/src/components/Editor/TableOfContents.vue index 2bc7f83130d..6d25d81bd80 100644 --- a/src/components/Editor/TableOfContents.vue +++ b/src/components/Editor/TableOfContents.vue @@ -7,7 +7,7 @@