Skip to content

Releases: westonruter/syntax-highlighting-code-block

1.5.0

02 Apr 19:41
eb75838
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.4.0...1.5.0

1.4.0

09 Mar 23:31
a158c67
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.3.1...1.4.0

Installation

Please install in WordPress via the Plugin Directory.

1.3.1

29 Dec 04:22
d054359
Compare
Choose a tag to compare
  • Fix ability to paste HTML markup into Code blocks (without it being converted to rich text). #245
  • Bump highlight.php to fix unexpected line number positioning. #246, #247
  • Fix line highlight background color on first render in Customizer and dynamically update default color when theme is changed. #251

Props to @allejo as always!

1.3.0

03 Dec 21:41
3a4b186
Compare
Choose a tag to compare

This release makes the necessary changes to add compatibility with WordPress 5.6 and Gutenberg 9.5.

  • Add language slug and name to <pre> wrapper element, including on data- attributes and an accessibility description (and SEO label) which is visually hidden by default. #208, #37
  • Add support for font size setting and fix line wrapping setting in Gutenberg 9.5. #228, #229, #230
  • Add support for Gutenberg 9.2. #200, #201, #188
  • Add option to remove styles from frontend via a syntax_highlighting_code_block_styling filter. #194, #212
  • Upgrade highlight.php to v9.18.1.3 to fix unexpected line number appearing on same line and empty code block causes highlight.php warning. #193, #189, #195
  • Bump highlight.php to 9.18.1.5 to improve performance for large code snippets. #223

Please see wiki for examples of advanced usage.

Props to @allejo as always! Thanks also to @mkaz.

1.2.3

30 Aug 06:00
eb49a95
Compare
Choose a tag to compare
  • Update highlight.php to v9.18.1.2, fixing UTF-8 characters being broken when given to \HighlightUtilities\splitCodeIntoArray(). #163. Props @allejo.
  • Update other dependencies.

1.2.2

04 Jul 04:00
b0ad70d
Compare
Choose a tag to compare

Fix ability for plugins to extend the Code block to have align support. Props @allejo. #128, #131

1.2.1

28 Jun 18:52
637f35a
Compare
Choose a tag to compare
  • Fix block validation errors when code contains special HTML characters. Add required escape() call in save function. #110, #118, #119
  • Fix compatibility with Gutenberg 8.3 which introduced server-side awareness of blocks. Fixes PHP notices for undefined index for highlightedLines and showLineNumbers with Gutenberg plugin. #116, #117
  • Update dependencies.

1.2.0

10 May 23:37
ecddb40
Compare
Choose a tag to compare

The plugin readme has been updated to include the latest features and behavior. Screenshot of new options for specifying highlighted lines, showing line numbers, and controlling line wrapping:

screenshot-1

For advanced usage, please see the new plugin wiki.

Huge thanks to @allejo for co-maintaining this project, tackling some of the biggest enhancements in this release in addition to maintaining the underlying highlight.php library that the plugin fundamentally depends on!

Changelog

  • ✨ Add support for highlighting specific lines. #20, #12
  • ✨ Use mark element to indicate highlighted lines, print styles immediately before block, ensure formatting when styles omitted, and add Wrap Lines option. #80, #78, #79
  • ✨ Add syntax_highlighting_code_block_auto_detect_languages filter, allowing you to restrict which languages are used for auto-detection. This can ensure the right language is used when the source is ambiguous. #36, #34
  • ✨ Define attribute schema in PHP with registered block type. #83
  • 🖍️ Remove padding from Code blocks. #82
  • 🖍️ Omit styles in RSS feeds and REST API responses. #93, #9.
  • 🐛 Register styles at wp_default_styles not wp_enqueue_scripts, ensuring that styles will be available in other contexts like AMP Reader mode. #35
  • 🐛 Fix compatibility with lightBlockWrapper for Code block in Gutenberg 7.9+. #73, #72
  • 🐛 Fix loading script dependencies list. #74
  • 🐛 Fix injection of classes in cached block output. #77
  • 🐛 Ensure proper text domain is passed to translation functions. #81
  • 🐛 Improve attribute naming. #92, #84, #95
  • 🐛 Improve robustness of injecting styles to prevent inadvertent display. #97

1.1.4

29 Jan 18:04
aa39c63
Compare
Choose a tag to compare
  • Use highlight-php instead of highlight.php as library directory name in build, fixing problems with loading stylesheets on some hosts (#30, #31).
  • Update highlight libs to 9.18.0 (#32).

1.1.3

15 Dec 15:33
f4c95d6
Compare
Choose a tag to compare
  • Fetch line-numbers.css over filesystem not HTTP. #25, #26
  • Update highlight libraries to 9.17.1. #27