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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syntax highlighting support for Swift #232

Merged
merged 13 commits into from
Apr 18, 2022
Merged

Conversation

jaclync
Copy link
Contributor

@jaclync jaclync commented Mar 14, 2022

Based on the initial work by @astralbodies #165

Regex and JavaScript aren't my strong suits, please feel free to correct/suggest anything - I just really wanted to see Swift code in p2 馃槃

Changes proposed in this Pull Request

Please note that there are still some edge cases that the script doesn't cover, like multiline strings with extended string delimiters. I think we can support the most common Swift code usage then add/update more upon feature requests.

Testing instructions

  1. Add or edit a post in Gutenberg editor
  2. Add SyntaxHighlighter Code block
  3. Select Swift as a language
  4. Copy and paste some code from this gist or any other Swift examples
  5. Save and preview
  6. Make sure its syntax highlighted

Screenshot / Video

You can view some sample posts on my test site.

Gutenberg editor post
Screen Shot 2022-03-14 at 3 38 45 PM Screen Shot 2022-03-14 at 3 37 54 PM

@renatho renatho added this to the 3.6.2 milestone Apr 18, 2022
Copy link
Contributor

@renatho renatho left a comment

Choose a reason for hiding this comment

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

Thank you for your PR, @jaclync!
Looks good and works well for me!

@renatho renatho merged commit 7f4283e into master Apr 18, 2022
@renatho renatho deleted the add-swift-brush-updated branch April 18, 2022 13:43
@renatho renatho mentioned this pull request Apr 19, 2022
This was referenced May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants