Statements like `List<Integer>` inside a Java code block nested in a Callouts breaks or overflows

Once you’ve done the above, delete everything above this line.

Steps to reproduce

A simple java code snippet inside a callout breaks when it encounters html tag like statements. If the code block is not nested inside the callout, then everything works fine. So this seems to be a bug with the callouts.

Step 1: Code Block

class Solution {
    public boolean containsDuplicate(int[] nums) {
        Set<Integer> set = new HashSet<>();
        for(int num : nums) {
            if(!set.add(num)) return true;
        }
        return false;
    }
}

Step 2: Nest the above Code Block inside a Callout

[!success] Optimized Approach

class Solution {
    public boolean containsDuplicate(int[] nums) {
        Set<Integer> set = new HashSet<>();
        for(int num : nums) {
            if(!set.add(num)) return true;
        }
        return false;
    }
}

You will see that all the statements below Set<Integer> set = new HashSet<>(); overflows from the callout.

Did you follow the troubleshooting guide? [Y/N] Y

Expected result

I came up with a work around. I inserted space between < and the text, so that it doesn’t interpret as HTML/XML tags.
I changed

Set<Integer> set = new HashSet<>();

to

Set< Integer > set = new HashSet<>();

to fix it.

Actual result

Environment

Sandbox Environment

SYSTEM INFO:
Obsidian version: v1.8.7
Installer version: v1.8.4
Operating system: #1 SMP PREEMPT_DYNAMIC Mon, 03 Feb 2025 16:27:16 +0000 6.13.1-2-MANJARO
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Actual Environment

SYSTEM INFO:
Obsidian version: v1.8.7
Installer version: v1.8.4
Operating system: #1 SMP PREEMPT_DYNAMIC Mon, 03 Feb 2025 16:27:16 +0000 6.13.1-2-MANJARO
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: dark
Community theme: none
Snippets enabled: 1
Restricted mode: off
Plugins installed: 8
Plugins enabled: 5
1: InlineCodeHighlight v1.0.1
2: Templater v2.9.1
3: Journals v1.4.3
4: Style Settings v1.0.9
5: Minimal Theme Settings v8.1.1

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.


Additional information

This looks to be the same as this report: