Skip to content
Permalink
Browse files
"keep the entity size within the limitation"
  • Loading branch information
headius committed Oct 28, 2014
1 parent 575b395 commit b8e10166a4f68d062fda7ed40758b2cbce51473c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
@@ -138,8 +138,14 @@ def value
matches = @value.scan(PEREFERENCE_RE)
rv = @value.clone
if @parent
sum = 0
matches.each do |entity_reference|
entity_value = @parent.entity( entity_reference[0] )
if sum + entity_value.bytesize > Document.entity_expansion_text_limit
raise "entity expansion has grown too large"
else
sum += entity_value.bytesize
end
rv.gsub!( /%#{entity_reference};/um, entity_value )
end
end
@@ -138,8 +138,14 @@ def value
matches = @value.scan(PEREFERENCE_RE)
rv = @value.clone
if @parent
sum = 0
matches.each do |entity_reference|
entity_value = @parent.entity( entity_reference[0] )
if sum + entity_value.bytesize > Document.entity_expansion_text_limit
raise "entity expansion has grown too large"
else
sum += entity_value.bytesize
end
rv.gsub!( /%#{entity_reference.join};/um, entity_value )
end
end
@@ -138,8 +138,14 @@ def value
matches = @value.scan(PEREFERENCE_RE)
rv = @value.clone
if @parent
sum = 0
matches.each do |entity_reference|
entity_value = @parent.entity( entity_reference[0] )
if sum + entity_value.bytesize > Document.entity_expansion_text_limit
raise "entity expansion has grown too large"
else
sum += entity_value.bytesize
end
rv.gsub!( /%#{entity_reference.join};/um, entity_value )
end
end

0 comments on commit b8e1016

Please sign in to comment.