Updating Blog Content With Product Insertion

I’d like for my authors to be able to insert products into our blog’s articles. Example:

Paragraph1
[product]product-handle1[/product]
Paragraph2
[product]product-handle45[/product]
Paragraph3…
[product]product-handle4[/product]

I found some code online, but it doesn’t iterate through all of the instances, it only winds up doing a replacement on the last one.

{% assign divider = '[product]' %}
{% assign dividerClose = '[/product]' %}
{% assign text = article.content | split: divider %} 

{{ text[0] }}

{% for divider in text offset:1 %}
{% assign x = forloop.index %}
{% assign newtext = text[x] | split: dividerClose %}
{% assign productHandle = newtext[0] %} 
{% assign product = all_products[productHandle] %} 
{%- include 'article-product' -%}
{{ newtext[1] }}
{% endfor %}

My ultimate goal is to do this for [product] and even have comma separated values for multiple products, as well as [collections] where I can insert a carousel of products. This would allow my visitors to add a product to cart directly from our article.

Any guidance or alternative solutions would be appreciated. If you’re a consultant and can write this, I would be interested in compensating for a solution.