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

Add ```language shortcut #180

Merged
merged 1 commit into from
Dec 18, 2020
Merged

Add ```language shortcut #180

merged 1 commit into from
Dec 18, 2020

Conversation

yscik
Copy link
Contributor

@yscik yscik commented Nov 18, 2020

Changes proposed in this Pull Request

  • Improve the current ``` shortcut to also allow specifying a language

Testing instructions

  • Open a post in the block editor
  • Type ```php and press enter
  • A Syntaxhighlighter Code block should be added with the language set to PHP
  • Type ``` and press enter
  • The code block should be added with Plain text language

@yscik yscik added this to the v3.6.0 milestone Nov 18, 2020
@yscik yscik requested a review from jom November 18, 2020 12:15
@yscik yscik changed the base branch from master to change/refactor-block November 18, 2020 12:16
Base automatically changed from change/refactor-block to master December 17, 2020 15:56
Copy link
Member

@jom jom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feature! I wonder how Gutenberg handles conflicting shortcuts between blocks.

@yscik
Copy link
Contributor Author

yscik commented Dec 18, 2020

Looks like there is a priority option for transforms, but not sure it applies to this. It's probably working as expected for anyone using this (inserting the Syntaxhighlighter Code block on ```, instead of the core Code block.)

@yscik yscik merged commit 0c1b420 into master Dec 18, 2020
@yscik yscik deleted the add/language-shortcut branch December 18, 2020 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants