mirror of
				https://github.com/Shopify/liquid.git
				synced 2025-11-04 00:01:04 -05:00 
			
		
		
		
	Render tag styling fixes
This commit is contained in:
		
							parent
							
								
									ddb45cd658
								
							
						
					
					
						commit
						604d899496
					
				@ -1,13 +1,13 @@
 | 
			
		||||
module Liquid
 | 
			
		||||
  class Render < Tag
 | 
			
		||||
    Syntax = /(#{QuotedString})#{QuotedFragment}*/o
 | 
			
		||||
    SYNTAX = /(#{QuotedString})#{QuotedFragment}*/o
 | 
			
		||||
 | 
			
		||||
    attr_reader :template_name_expr, :attributes
 | 
			
		||||
 | 
			
		||||
    def initialize(tag_name, markup, options)
 | 
			
		||||
      super
 | 
			
		||||
 | 
			
		||||
      raise SyntaxError.new(options[:locale].t("errors.syntax.render".freeze)) unless markup =~ Syntax
 | 
			
		||||
      raise SyntaxError.new(options[:locale].t("errors.syntax.render".freeze)) unless markup =~ SYNTAX
 | 
			
		||||
 | 
			
		||||
      template_name = $1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -110,7 +110,7 @@ class RenderTagTest < Minitest::Test
 | 
			
		||||
    file_system = StubFileSystem.new('snippet' => 'echo')
 | 
			
		||||
    assert_equal 'echoecho',
 | 
			
		||||
      Template.parse('{% render "snippet" %}{% render "snippet" %}')
 | 
			
		||||
              .render!({}, registers: { file_system: file_system })
 | 
			
		||||
      .render!({}, registers: { file_system: file_system })
 | 
			
		||||
    assert_equal 1, file_system.file_read_count
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@ class PartialCacheUnitTest < Minitest::Test
 | 
			
		||||
  def test_uses_the_file_system_register_if_present
 | 
			
		||||
    context = Liquid::Context.build(
 | 
			
		||||
      registers: {
 | 
			
		||||
        file_system: StubFileSystem.new('my_partial' => 'my partial body')
 | 
			
		||||
        file_system: StubFileSystem.new('my_partial' => 'my partial body'),
 | 
			
		||||
      }
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
@ -41,12 +41,12 @@ class PartialCacheUnitTest < Minitest::Test
 | 
			
		||||
    )
 | 
			
		||||
    context_one = Liquid::Context.build(
 | 
			
		||||
      registers: {
 | 
			
		||||
        file_system: shared_file_system
 | 
			
		||||
        file_system: shared_file_system,
 | 
			
		||||
      }
 | 
			
		||||
    )
 | 
			
		||||
    context_two = Liquid::Context.build(
 | 
			
		||||
      registers: {
 | 
			
		||||
        file_system: shared_file_system
 | 
			
		||||
        file_system: shared_file_system,
 | 
			
		||||
      }
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user