Support svg:foreignObject

Fixes to the html5lib sanitizer and maruku to support the SVG <foreignObject> element.
Also update to the latest REXML.
This commit is contained in:
Jacques Distler 2008-02-03 23:56:17 -06:00
parent 15640ca7a3
commit 5dd0507acc
6 changed files with 28 additions and 23 deletions

View file

@ -990,7 +990,9 @@ module REXML
end
def to_a
values.flatten
attributes = []
each_attribute {|attr| attributes << attr}
attributes
end
# Returns the number of attributes the owning Element contains.

View file

@ -63,7 +63,7 @@ module REXML
def write_element( node, output )
output << "<#{node.expanded_name}"
node.attributes.to_a.sort_by {|attr| attr.name}.each do |attr|
node.attributes.to_a.sort_by {|attr| attr.expanded_name}.each do |attr|
output << " "
attr.write( output )
end unless node.attributes.empty?

View file

@ -128,7 +128,9 @@ module REXML
def wrap(string, width)
# Recursivly wrap string at width.
return string if string.length <= width
place = string.rindex(' ', width) # Position in string with last ' ' before cutoff
place = string.rindex(/\s/, width) # Position in string with last ' ' before cutoff
place = string.index(/\s/) if place.nil? # Otherwise first space
return string if place.nil? # otherwise, whole string
return string[0,place] + "\n" + wrap(string[place+1..-1], width)
end