Features
  • An option to set a default code language for all code block on the forum without provided language
  • An options to set options for specific code languages (for example, set custom 'modes' for CodeMirror editor)
Fixes
  • Fixed a E_NOTICE error about undefined index
Fixes a problem with upgrading.

If any other errors happen, try to fully remove the addon. Than install it again with this version.
Code 2.1.0 was rewritten from scratch. It is not compatible with previous addon version and XF below 2.1 but it can handle code block titles from previous addon versions! There is no way to upgrade existing addon!

Remove installed Code addon from you forum. After this install this version as a new addon!

New features
  • New way of setting parameters for code BB code: [code title="..." lang="..." highlight="..." class="..."]...[/code]
  • Line highlighting via highlight BB code parameter. Example: ... highlight="3, 5-8" ... will highlight lines 3, 5, 6, 7 and 8
    highlighted_code.png

  • "Highlight lines" text field in "Insert code" editor dialog:
    highlight_lines_text_field.png

  • Custom code block CSS class via class BB code parameter. Example: ... class="error-log" ... will add error-log class to the whole code block
  • "Backward compatibility" option to support code block titles with the following format: [code=title|lang]...[/code]. Turned off by default!
Changes
  • Improved addon stability, better code quality
  • Removed "Dark" code style support
  • XF 2.1 and PHP 7+ are required now to install the addon
Top