Code cleanup

This commit is contained in:
Muhsin 2022-12-23 16:34:06 +05:30
parent 0f8e5c6fe1
commit efa3d41ea6

View file

@ -28,15 +28,9 @@ module Liquidable
self.content = template.render(message_drops)
end
# def get_liquid_content
# content.gsub(/{{([^}]*)}}/) do |_match|
# "{{#{$1} | default: ''}}"
# end
# end
def modified_liquid_content
# This regex is used to match the code blocks in the content
# We don't want to process liquid in code blocks
content.gsub(/```(.*?)```/m, '{% raw %}```\\1```{% endraw %}')
content.gsub(/`(.*?)`/m, '{% raw %}`\\1`{% endraw %}')
end
end