Skip to content

Commit 13a8046

Browse files
committed
Merge pull request #76 from jparker/rails-source-annotations
added rails source annotation support
2 parents 2881d74 + 2e90819 commit 13a8046

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/haml-rails.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ class Railtie < ::Rails::Railtie
4444
end
4545
end
4646
end
47+
48+
# Configure source annoatation on haml files (support for HAML was
49+
# provided directly by railties 3.2..4.1 but was dropped in 4.2.
50+
if ::Rails.version.to_s >= '4.2'
51+
initializer 'haml_rails.configure_source_annotation' do
52+
SourceAnnotationExtractor::Annotation.register_extensions('haml') do |tag|
53+
/\s*-#\s*(#{tag}):?\s*(.*)/
54+
end
55+
end
56+
end
4757
end
4858
end
4959
end

0 commit comments

Comments
 (0)