Fix strip_markers step
This commit is contained in:
		@@ -4,16 +4,6 @@
 | 
			
		||||
 | 
			
		||||
module Skeksis
 | 
			
		||||
  class IR < Array
 | 
			
		||||
    def collapse_verbatim_blocks!
 | 
			
		||||
      last_block = nil
 | 
			
		||||
      self.each do |line|
 | 
			
		||||
        type = get_type(line)
 | 
			
		||||
 | 
			
		||||
        # Last thing
 | 
			
		||||
        last_block = type
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def strip_markers!
 | 
			
		||||
      self.map! do |line|
 | 
			
		||||
        type = line[:type]
 | 
			
		||||
@@ -39,12 +29,15 @@ module Skeksis
 | 
			
		||||
          { type: type, link: link, text: text }
 | 
			
		||||
        when :verbatim
 | 
			
		||||
          # TODO: Match with syntax highlighting, maybe 
 | 
			
		||||
          m = /^```(.*)/.match(text)
 | 
			
		||||
          unless m.nil?
 | 
			
		||||
            nil
 | 
			
		||||
          else
 | 
			
		||||
            { type: type, content: content }
 | 
			
		||||
          end
 | 
			
		||||
          content.map! do |line|
 | 
			
		||||
            m = /^```(.*)/.match(line)
 | 
			
		||||
            unless m.nil?
 | 
			
		||||
              nil
 | 
			
		||||
            else
 | 
			
		||||
              line
 | 
			
		||||
            end
 | 
			
		||||
          end.compact!
 | 
			
		||||
          { type: type, content: content }
 | 
			
		||||
        else
 | 
			
		||||
          { type: type, content: content }
 | 
			
		||||
        end
 | 
			
		||||
@@ -151,10 +144,5 @@ module Skeksis
 | 
			
		||||
        :text
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def parse_line(line)
 | 
			
		||||
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user