update the heading page

This commit is contained in:
Hans Pagel
2020-09-15 16:44:20 +02:00
parent 4150aee687
commit a917264057
4 changed files with 31 additions and 2 deletions

View File

@@ -45,4 +45,33 @@ context('/api/extensions/heading', () => {
.find('h3')
.should('contain', 'Example Text')
})
it('the button should toggle the headline', () => {
cy.get('.ProseMirror h1')
.should('not.exist')
cy.get('.demo__preview button:nth-child(1)')
.click()
cy.get('.ProseMirror')
.find('h1')
.should('contain', 'Example Text')
cy.get('.demo__preview button:nth-child(1)')
.click()
cy.get('.ProseMirror h1')
.should('not.exist')
})
it('should make a headline from the default markdown shortcut', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.clearContent()
})
cy.get('.ProseMirror')
.type('# Headline')
.find('h1')
.should('contain', 'Headline')
})
})

View File

@@ -1,5 +1,5 @@
# Heading
The Heading extension adds support for headlines. Headlines are rendered with `<h1>` to `<h6>` HTML tags. By default six headline levels are enabled, but you can pass an array to only allow a few levels, see an example below.
The Heading extension adds support for headings of different levels. Headings are rendered with `<h1>`, `<h2>`, `<h3>`, `<h4>`, `<h5>` or `<h6>` HTML tags. By default all six headline levels are enabled, but you can pass an array to only allow a few levels. Check the usage example to see how this is done.
Type `# ` at the beginning of a new line and it will be magically transformed to a headline, same for `## `, `### `, `#### `, `##### ` and `###### `.

View File

@@ -136,7 +136,6 @@
link: /api/extensions/hard-break
- title: Heading
link: /api/extensions/heading
draft: true
- title: History
link: /api/extensions/history
- title: HorizontalRule