Good day!
In Craft CMS 3, I'm tring to configure the replacement of tags for markdown via replace, everything works except for the tag {{ loop.index }}
Please tell me how to properly configure to work correctly {{ loop.index }}?
{{ block.markdownContent|markdown
|replace('<p>', '<p class="section__paragraph text">')
|replace('<h2>', '<h2 class="section__title title">')
|replace('<a ', '<a class="link link-color"')
|replace('<ul>', '<ul class="attention">')
|replace('<li>', '<li class="attention__item"><p class="attention__text">')
|replace('</li> ', '</p></li>')
|replace('<ol>', '<ol class="remark list">')
|replace('<li>', '<li class="remark__item item"><p class="remark__text"><span class="remark__label">{{ loop.index }}</span>')
|replace('</li> ', '</p></li>')|raw }}
Can you advise other ways of realizing this task.
{{ loop.index }}is usually part of Twig language. I'm not sure why/how you are going to change the syntax of the language, More important: why does your field contains Twig Syntax in the first place? – Robin Schambach Apr 19 '18 at 09:18