middleman-syntax icon indicating copy to clipboard operation
middleman-syntax copied to clipboard

haml 6 support

Open tnir opened this issue 1 year ago • 0 comments

middlean-syntax 3.3.0 does not support for haml 6.0.0.beta.2.

A combination of haml 6.0.0.beta.2 and middlean-syntax 3.3.0 causes errors on middleman build (maybe middleman server as wel).

Why

https://github.com/middleman/middleman-syntax/blob/d1b3edd4d2a5ad1028621f6c03ab709a1d94d4e2/lib/middleman-syntax/haml_monkey_patch.rb#L1-L6

does not support haml 6 classes.

Workaround

$ git diff lib/middleman-syntax/haml_monkey_patch.rb
--- a/vendor/bundle/ruby/3.1.0/gems/middleman-syntax-3.3.0/lib/middleman-syntax/haml_monkey_patch.rb 2022-08-31 00:00:00.123456789 +0000
+++ b/vendor/bundle/ruby/3.1.0/gems/middleman-syntax-3.3.0/lib/middleman-syntax/haml_monkey_patch.rb 2022-08-31 00:00:00.123456789 +0000
@@ -1,8 +1,9 @@
 # If Haml is around, define a :code filter that can be used to more conveniently output highlighted code.
 if defined? Haml
   module Haml
-    class Filters
-      class Code < Base
+    module Filters
+      module Code
+        include Base
 
         def render(code)
           code = code.rstrip

tnir avatar Aug 31 '22 00:08 tnir