Rendering issue with highlight in 0.111.3

I am migrating from (a very old) version 0.92.0 to 0.111.3 and I am seeing an issue with “highlighting”.

The (.md) code is the following:

* Changed the way the plugin gets registered to the VST3 world (implements the _main_ `GetPluginFactory()` function) with an easier and less error prone syntax: 
    {{< highlight cpp >}}
EXPORT_FACTORY Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory()
{
  return JambaPluginFactory::GetVST3PluginFactory<
    pongasoft::test::jamba::RT::JambaTestPluginProcessor, // processor class (Real Time)
    pongasoft::test::jamba::GUI::JambaTestPluginController // controller class (GUI)
  >("pongasoft",                 // vendor
    "https://www.pongasoft.com", // url
    "support@pongasoft.com",     // email
    stringPluginName,            // plugin name
    FULL_VERSION_STR,            // plugin version
    Vst::PlugType::kFx           // plugin category (can be changed to other like kInstrument, etc...)
   );
}
    {{< / highlight >}}

With 0.92.0, I get the proper/expected output (all whitespace is preserved):

With 0.111.3, whitespace is missing and as a result it is not properly aligned

Does anybody have any idea what is wrong?

Note: you can view the current version live at Release Notes - Jamba (scroll to down to 4.4.0)

Thank you

The change was introduced in v0.100.0.

You have several options…

Option 1: Indent the code to match the indentation of the shortcode tags

* Changed the way the plugin gets registered to the VST3 world (implements the _main_ `GetPluginFactory()` function) with an easier and less error prone syntax:

    {{< highlight cpp >}}
    EXPORT_FACTORY Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory()
    {
      return JambaPluginFactory::GetVST3PluginFactory<
        pongasoft::test::jamba::RT::JambaTestPluginProcessor, // processor class (Real Time)
        pongasoft::test::jamba::GUI::JambaTestPluginController // controller class (GUI)
      >("pongasoft",                 // vendor
        "https://www.pongasoft.com", // url
        "support@pongasoft.com",     // email
        stringPluginName,            // plugin name
        FULL_VERSION_STR,            // plugin version
        Vst::PlugType::kFx           // plugin category (can be changed to other like kInstrument, etc...)
      );
    }
    {{< / highlight >}}

Option 2: Use fenced code blocks

With fenced code blocks your markdown is portable (e.g., it renders correctly on GitHub, GitLab, etc.). Indent the code to match the indentation of the code fences.

* Changed the way the plugin gets registered to the VST3 world (implements the _main_ `GetPluginFactory()` function) with an easier and less error prone syntax:

    ```cpp
    EXPORT_FACTORY Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory()
    {
      return JambaPluginFactory::GetVST3PluginFactory<
        pongasoft::test::jamba::RT::JambaTestPluginProcessor, // processor class (Real Time)
        pongasoft::test::jamba::GUI::JambaTestPluginController // controller class (GUI)
      >("pongasoft",                 // vendor
        "https://www.pongasoft.com", // url
        "support@pongasoft.com",     // email
        stringPluginName,            // plugin name
        FULL_VERSION_STR,            // plugin version
        Vst::PlugType::kFx           // plugin category (can be changed to other like kInstrument, etc...)
      );
    }
    ```

Option 3: Override the built-in shortcode

mkdir -p layouts/shortcodes
touch layouts/shortcodes/highlight.html

Then insert:

{{ if len .Params | eq 2 }}{{ highlight (trim .Inner "\n\r") (.Get 0) (.Get 1) }}{{ else }}{{ highlight (trim .Inner "\n\r") (.Get 0) "" }}{{ end }}
1 Like

What a thorough reply! Explaining what the problem is and giving 3 options on how to fix it. Amazing! Thank you so much.

I tried option 1 and it works great!

Thank you

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.