slime-lang / slime

Minimalistic HTML templates for Elixir, inspired by Slim.
http://slime-lang.com
MIT License
368 stars 57 forks source link

Multiline comments #126

Closed little-bobby-tables closed 7 years ago

little-bobby-tables commented 7 years ago

I've noticed that Slim handles HTML comments (/!) just like verbatim text nodes (| and ') — complete with interpolation — so I decided to move the common semantics into a text_block rule.

The change introduces:

What do you think?

little-bobby-tables commented 7 years ago

Thanks for your comments, @Rakoth! I've added a test case for ' without content and split text_item into verbatim_text and comment.

However, I've noticed that credo now reports the TextBlock.render function as having excessively high ABC complexity — do you have any ideas on how to refactor it?

Rakoth commented 7 years ago

@little-bobby-tables Since it is already in a separate module, we could simply extract parts of it into private functions.