Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markdown: # + space for H1 too? #24747

Closed
maximebj opened this issue Aug 23, 2020 · 2 comments · Fixed by #25075
Closed

markdown: # + space for H1 too? #24747

maximebj opened this issue Aug 23, 2020 · 2 comments · Fixed by #25075
Assignees
Labels
[Block] Heading Affects the Headings Block [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@maximebj
Copy link
Contributor

In prior versions of WordPress, Heading blocks only showed H2, H3, H4 but it changed in WP 5.5

In markdown, it's impossible to fire a H1 with # + Space. It only works with 2 "#'.
Should we had # + space to get an H1 too?

Maybe there was a reason to not implement it. But I guess it was to limite H1 use in document.
More and more themes add the feature to hide the page title, so we can use our own H1 wherever we want.

@talldan talldan added [Block] Heading Affects the Headings Block Needs Testing Needs further testing to be confirmed. labels Aug 28, 2020
@getdave
Copy link
Contributor

getdave commented Sep 4, 2020

I tested this on WP 5.5.1 and was able to replicate. All the heading levels work except #1. To replicate:

  • Use a site with WP 5.5.X
  • Create a new Post.
  • ✅ In the main post body content type ## Hello - you will see this converted into a heading block with h2 level.
  • ✅ In the main post body content type ### Hello - you will see this converted into a heading block with h3 level.
  • ❌ In the main post body content type # Hello - you will see this is not converted into a heading block with h1 level. Instead the raw text remains.

Screen Capture on 2020-09-04 at 14-49-39

Probably needs adjusting here

...[ 2, 3, 4, 5, 6 ].map( ( level ) => ( {
type: 'prefix',
prefix: Array( level + 1 ).join( '#' ),
transform( content ) {
return createBlock( name, {
level,
content,
} );
},
} ) ),

@getdave getdave added [Type] Bug An existing feature does not function as intended [Type] Enhancement A suggestion for improvement. and removed Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended labels Sep 4, 2020
@aristath
Copy link
Member

aristath commented Sep 4, 2020

Created a PR for this in #25075

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Heading Affects the Headings Block [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants