bkiers / Liqp

An ANTLR based 'Liquid Template' parser and rendering engine.
MIT License
165 stars 94 forks source link

update map string parse in blockNode asString() #302

Closed fw-udbhav closed 5 months ago

fw-udbhav commented 6 months ago

BlockNode render uses "String.valueOf(object)" to convert the object to String.

in case of HashMap<Object, Object> mapObject, String.valueOf(mapObject) doesn't return an appropriate String.

For example: String.valueOf(mapObject) will give '=' instead of ':' as the delimiter which:

  1. doesn't look pretty as we say in pretty print.
  2. it's not easy to decode while reading.

So, merging this PR will help us and other devs.

After this PR, the mapObject will look something like below:

  1. {name: {first-name: test-first-name, last-name: test-last-name}} vs current output: {name={first-name=test-first-name, last-name=test-last-name}}

  2. {address: {area: bellandur, flat: a-1234, contact: {alternate contact: 12341234, contact: 9898989898}}, name: {first-name: test-first-name, last-name: test-last-name}}

  3. {name: {nos2: [25, 1254], nos1: [25, 1254]}}

the above 3 sample output is what I got when I am trying to render root element of the HashMap <?, ?> -> output provides all the keys and corresponding values.

I took a fork from tag: 0.8.3.3

fw-udbhav commented 6 months ago

since I don't want all the changes from master branch but rather from a tag 0.8.3.3 we would like these changes to be present in a tag.

do we have any feature branch to push to ? will merging to master a great choice ?