Open aishek opened 9 years ago
Hi Alexandr,
Yes, this should be possible. Where is this set? In an initializer?
Hi Justin,
I am using initializer from engine: https://github.com/ai/evil-blocks/blob/master/lib/evil-blocks-rails.rb
Oh. I'm not sure how that would work, then.
I created initializer:
# config/initializers/brakeman_slim.rb
if defined?(Slim::Parser)
shortcut = Slim::Parser.options[:shortcut]
shortcut['@'] = { attr: 'data-role' }
shortcut['@@'] = { attr: 'data-block' }
Slim::Engine.options[:merge_attrs]['data-role'] = ' '
Slim::Engine.options[:merge_attrs]['data-block'] = ' '
end
Run brakeman, and got Unknown line indicator
error on the template:
@@test
| Hello
If the initializer is defined inside your project, then I can make Brakeman work with it.
Justin, thank you very much, I'd like to make pull request by myself. If I add code to brakeman, which will load config/brakeman.rb
if present, where developer could put slim settings or other, it will be ok?
No, Brakeman cannot execute any code from the application, as that would be a security issue.
I'm stuck, Justin, please help :) Is there any possibility to told brakeman to use Slim shortcuts?
Yes, but it won't be very straightforward, sorry. Brakeman will need to read the shortcuts from the initializer and then set them when actually processing the Slim templates.
Ok, thanks.
I need to extend Slim with shortcuts, but Brakeman shows shortcuts in templates as errors.
Is it possible to extend Slim with shortcuts for Brakeman?