How do I reduce/remove the leading and trailing blank lines for my plugin Block

Newbie: I’m building my first plugin.

An instance of the plugin contains a JSON record. Similar to:

{"json": "contents"}

By default code blocks are displayed with a blank line at the start and end.

Goal: I would like my block to appear as a single line of text without leading/trailing blank lines.

Is this possible? I’m guessing it’s a CSS thingy but I haven’t worked with CSS before.

… curiously in this forum the block appears as a one-liner. However Obsidian displays all blocks with blank lines fore and aft.

This CSS trims the spaces at the top & bottom of codeblocks in reading view.

.markdown-rendered pre {
  padding-top: 0px;
  padding-bottom: 0px;
}

You can inject your custom CSS class (say, your-plugin-code-block) to code blocks that your plugin targets, and then add the following to styles.css of your plugin:

.markdown-rendered pre.your-plugin-code-block {
  padding-top: 0px;
  padding-bottom: 0px;
}

Optionally you may be able to further remove unwanted spacing by removing the copy button of the code block.