diff --git a/cypress/e2e/sections.spec.js b/cypress/e2e/sections.spec.js index 2aa5a327965..bca3b00a5b7 100644 --- a/cypress/e2e/sections.spec.js +++ b/cypress/e2e/sections.spec.js @@ -47,7 +47,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() @@ -56,7 +56,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() @@ -70,13 +70,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') }) @@ -87,15 +87,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 306ef67526a..61d681beb1e 100644 --- a/src/components/Editor/TableOfContents.vue +++ b/src/components/Editor/TableOfContents.vue @@ -2,7 +2,7 @@