Skip to content

Instantly share code, notes, and snippets.

@asok
Last active December 10, 2015 00:39
Show Gist options
  • Save asok/4352818 to your computer and use it in GitHub Desktop.
Save asok/4352818 to your computer and use it in GitHub Desktop.
Scenario: html-erb-mode not working
Given I have master of mmm-mode in "~/mmm-mode" directory
And I have file "test.el" with content:
'''
(add-to-list 'load-path "~/mmm-mode/")
(require 'mmm-auto)
(require 'mmm-erb)
(setq mmm-global-mode 'auto)
(mmm-add-mode-ext-class 'html-erb-mode nil 'html-js)
(mmm-add-mode-ext-class 'html-erb-mode nil 'html-css)
(mmm-add-mode-ext-class 'html-erb-mode "\\.html\\.erb\\'" 'erb)
(mmm-add-mode-ext-class 'html-erb-mode "\\.jst\\.ejs\\'" 'ejs)
(add-to-list 'auto-mode-alist '("\\.html\\.erb\\'" . html-erb-mode))
(add-to-list 'auto-mode-alist '("\\.jst\\.ejs\\'" . html-erb-mode))
'''
When I run "emacs -q -l test.el"
And I open "test.html.erb" file with content:
'''
<% if true %>
<p>Test</p>
<% else %>
<script type="text/javascript">
var variable = true
</script>
<% end %>
'''
Then I see font highlighting in the line "<% if true %>"
But I do not see font highlighting in the line "var variable = true"
Scenario: html-erb-mode working
Given I have master of mmm-mode in "~/mmm-mode" directory
And I have file "test.el" with content:
'''
(add-to-list 'load-path "~/mmm-mode/")
(require 'mmm-auto)
(require 'mmm-erb)
(setq mmm-global-mode 'auto)
(mmm-add-mode-ext-class 'html-erb-mode "\\.html\\.erb\\'" 'erb)
(mmm-add-mode-ext-class 'html-erb-mode nil 'html-js)
(mmm-add-mode-ext-class 'html-erb-mode nil 'html-css)
(mmm-add-mode-ext-class 'html-erb-mode "\\.jst\\.ejs\\'" 'ejs)
(add-to-list 'auto-mode-alist '("\\.html\\.erb\\'" . html-erb-mode))
(add-to-list 'auto-mode-alist '("\\.jst\\.ejs\\'" . html-erb-mode))
'''
When I run "emacs -q -l test.el"
And I open "test.html.erb" file with content:
'''
<% if true %>
<p>Test</p>
<% else %>
<script type="text/javascript">
var variable = true
</script>
<% end %>
'''
Then I see font highlighting in the line "<% if true %>"
And I see font highlighting in the line "var variable = true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment