Strip the code block markdown

Hello,

I wanted to check with you as I know my solution isn’t the optimal, costing me an extra 1 operations potentialy :slight_smile:

Issue; GPT spit out the content of the HTML code with the markdown code block

code

I want to strip out the codeblock so I can just copy paste this into my site

right know I’m using 2 replace modules (because I believe make do not support the ungreedy option,

here is the regex101 link where my regex work, however I’m unable to replicate the same on Make scenario, the work around I have as we speak is to search for the first expression (html) and then a second one to search for the ()

here is my scenario

any chance I can combine both replace ? I’m sure I’m missing something

Thank you

Try this:

html\s*([\s\S]*?)\s*

L

1 Like

Welcome to the Make community!

You don’t even need a MODULE for this.

You can use the built-in function replace

e.g.:

{{ replace(2.result; "/(?:```.*\s+|\s+```)/g"; emptystring) }}

Screenshot_2024-07-13_210753

Proof: https://regex101.com/r/2HEaUn/1

For more information, see the function documentation in the Help Center.

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

4 Likes

Glad I could help!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

4. Do join the unofficial Make Discord server for live chat and video assistance

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!