该插件尚未通过WordPress的最新3个主要版本进行测试。 当与较新版本的WordPress一起使用时,可能不再受到维护或支持,并且可能会存在兼容性问题。

Code Prettify

描述

Uses a customized version of the Code Prettify library to support local styles and scripts. Plugin applies code highlighting automatically to all <pre> tags on the page.

Compatible with Gutenberg and doesn’t lock you in with specific markup requirements.

Development

Plugin development on GitHub.

Credits

Created and maintained by Kaspars Dambis. All of my open source work is available on GitHub.

Use Contact Form 7? Storage for Contact Form 7 is my commercial plugin (GPL license) for storing all form submissions in your WordPress database.

Cover photo by Yuri Samoilov

屏幕截图

  • Syntax highlighting applied to a <pre> block and inline <code> segments.

安装

Simply upload the plugin and active it. It works out of the box and doesn’t have any configuration options.

常见问题

None, yet.

评价

2022年3月30日
Used with a block-based theme and it worked perfectly. Love that there is no configuration required and it auto-detects <code> and <pre> tags. Great plugin, thank you!
2021年7月26日
Your plugin makes me very secure and happy to use because it doesn't make me dependent, I can disable it without affecting the articles. Good job. I just hope you can keep the plugin up to date to be compatible with new versions of WordPress. Thank you!
2020年4月26日
This plugin is exactly what I was looking for, just one friendly suggestion please add a toggle to switch themes to dark. or add a setting where we can do that. thank a lot for this neat and clean plugin
2019年11月13日
Finally a plugin that works with the outdated "Crayon Syntax Highlighter" plugin So I don't have to mess around with every post.
阅读所有18条评价

贡献者及开发者

“Code Prettify” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

将“Code Prettify”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

1.5.1 (November 8, 2021)

  • Fix the deprecation notice for how the data is passed to the script.
  • Mark as tested with WordPress 5.8.

1.5.0 (April 19, 2020)

  • Preload the prettify.css file for performance improvements.
  • Add WordPress coding standards checks.
  • Add support for Composer install.

1.4.2 (January 14, 2019)

  • Switch to legacy PHP array syntax for better compatibility.

1.4.1 (December 21, 2018)

  • Add a trailing semicolon to all JS files to support concatenation.

1.4.0 (December 20, 2018)

  • Update the Prettify library.
  • Don’t highlight standalone <code> blocks without the <pre> wrapper.
  • Mark as tested with WordPress 5.0.

1.3.4

  • Update the Prettify library.
  • Ensure that Prettify styles are applied to the contents of <pre> and <code> elements.

1.3.3

  • Update the Prettify library.
  • Highlight <code> blocks too.

1.0

  • Initial release.