module Marten::Template::Tag::CanSplitSmartly


Allows to split expressions by respecting literal values.

This module provides the ability to split string contents by respecting the presence of single-quoted or double-quoted expressions (which can themselves contain spaces):

Tag.split_smartly("This is a 'simple test'")   # => ["This", "is", "a", "'simple test'"]
Tag.split_smartly("This is a \"simple test\"") # => ["This", "is", "a", "\"simple test/""]

Direct including types

Defined in:


Instance Method Summary

Instance Method Detail

def split_smartly(expression : String) : Array(String) #

Split a string expression and returns an array of strings.

[View source]