Releases: westonruter/syntax-highlighting-code-block
Releases · westonruter/syntax-highlighting-code-block
1.5.0
What's Changed
- Omit language label for code blocks in feeds by @westonruter in #716
- Fix stylesheet name issue by @bianqui149 in #731
- Opt to register styles in standard way by @westonruter in #785
- Support exiting Code block with triple enter and remove legacy code for WP<6.1 by @westonruter in #786
- Ensure editor highlights expected line numbers when
<br>
present by @westonruter in #806 - Fix compatibility with Gutenberg 17.1 after it removed preserveWhiteSpace serialisation differences by @westonruter in #791
- Bump PHPStan to level 4 and fix typos by @westonruter in #708
- Bump PHPStan to level 5 by @westonruter in #712
- Bump PHPStan to level 9 and bump PHP to 7.4 by @westonruter in #713
- Utilize phpstan-wordpress by @westonruter in #717
- Fix autoloader's callable's return type by @szepeviktor in #720
- Move functions to inc/ by @szepeviktor in #721
- Fix badge in README by @szepeviktor in #722
- Update packages, pin to exact versions, and add wp-env helper by @westonruter in #723
- Use dependabot group for wordpress package updates by @westonruter in #739
- Update phpcs config, bump versions, add wp-env config, fix build, remove PHPCS exclude by @westonruter in #778
- Automate checking for upstream changes to Code block's edit.js by @westonruter in #787
- Run composer update by @westonruter in #799
- Bump node from 18 to 20 by @westonruter in #807
- Create new dist build process by @westonruter in #788
New Contributors
- @szepeviktor made their first contribution in #720
- @bianqui149 made their first contribution in #731
Full Changelog: 1.4.0...1.5.0
1.4.0
What's Changed
- Consolidate readmes into single README.md by @westonruter in #264
- Html error fix (div changed to span) by @brokul-dev in #285
- iphone font fix by @brokul-dev in #289
- Hide overflow on code-block-overlay to prevent doubled scrollbars by @westonruter in #302
- Migrate to GitHub Actions for our CI by @allejo in #407
- Bump highlight.php to v9.18.1.7 by @allejo in #406
- Update wordpress packages by @westonruter in #631
- Update packages and modernize by @westonruter in #688
- Register editor script/style with block instead of using
enqueue_block_editor_assets
by @westonruter in #690 - Fix CI by @westonruter in #691
- Update ESLint setup by @thelovekesh in #692
- Prevent shortcodes/embeds from being rendered by @westonruter in #696
- Prevent highlighted lines in editor from overflowing container by @westonruter in #699
- Use README.md as canonical and generate readme.txt from it at build time by @westonruter in #265
New Contributors
- @brokul-dev made their first contribution in #285
- @dependabot made their first contribution in #345
- @thelovekesh made their first contribution in #692
Full Changelog: 1.3.1...1.4.0
Installation
Please install in WordPress via the Plugin Directory.
1.3.1
- 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
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 ondata-
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.
1.2.3
1.2.2
1.2.1
- Fix block validation errors when code contains special HTML characters. Add required
escape()
call insave
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
andshowLineNumbers
with Gutenberg plugin. #116, #117 - Update dependencies.
1.2.0
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:
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
notwp_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