middleman / middleman-syntax

Code syntax highlighting plugin via Rouge for Middleman
https://middlemanapp.com
MIT License
179 stars 57 forks source link

Remove trailing blank lines from HAML's :code filter #79

Closed MaxLap closed 2 years ago

MaxLap commented 3 years ago

Without this change, every blank lines until other content in the haml file will be sent to the :code filter, which leads to empty lines in the code block:

Hello world
555

:code
  # lang: ruby
  def hello
    puts 'hi'
  end

BYe

image

This is even done in the :javascript filter, which wouldn't care about those: https://github.com/haml/haml/blob/000b6657b5a9fbc18e64ba75edfd2a2a2c8e8bc2/lib/haml/filters.rb#L220