Displaying the Anki Cloze Anything filed in non-cloze card types. How to strip out the Cloze Anything markup?

I use the Cloze Anything add-on that helps me use cloze deletions in non-cloze note types. It’s been working great. However I would like to display the Cloze field in other card types but a problem I encounter is that it then also displays the Cloze Anything markup - ((c1::text)) - and I dont want it to. Can anybody help me create a script that adresses the issue. As a tech noob I tried asking ChatGPT to make it for me but to no avail :(.

So in short, this is what my fields look like:

this is what the card currently looks like on the left, and on the right what I want it to look like:

The html for the Front of my card:

{{#IrregularCloze}} ⭑ {{/IrregularCloze}} {{Front}} {{tts de_DE:Front}}

the Back:

{{FrontSide}} 
<hr id=answer> 
<span class=back> {{Back}} </span> 
<div class=notesstyle> 
<hr id=answer> 
{{#Plural}} [Plural]: {{Plural}} <br> {{/Plural}} 
{{#Sentence}} [Sentence]: {{Sentence}} <br> {{/Sentence}} 
{{#IrregularCloze}} [Irregularities]: <br> 
   <div style="padding-left:1em;"> {{IrregularCloze}} </div> 
{{/IrregularCloze}} 
{{Notes}}```

You don’t need a script for that. You can use Find and Replace to remove those. Search for ((c1::, ((c2::, and )) – replace them with nothing.

I don’t think you understood me correctly. I dont want to delete the cloze markup from the filed, as I want it to create me a cloze card. I want it to not be visible when it is displayed in the bottom section of a normal card type, where I display additional information. See the html for the back of my card.

OK I figures it out for myself, or rather I run ChatGPT into the ground to figure it out for me. Here is the new script, it also puts everything tha was in the ((cx::…)) patterns in bold.

$('span.irregularnotes').each(function() { var html = $(this).html(); // Replace all instances of ((cX::...)) with the content inside the parentheses and wrap it with <strong> tags html = html.replace(/\(\(c\d+::([^\)]+)\)\)/g, "<strong>$1</strong>"); $(this).html(html); });