Skip to content

Commit

Permalink
Updated vendor copy of html-scanner to support better xml parsing
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2131 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jamis committed Sep 5, 2005
1 parent 873be12 commit bfdb437
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions actionpack/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*SVN*

* Updated vendor copy of html-scanner to support better xml parsing

* Added :popup option to UrlHelper#link_to #1996 [gabriel.gironda@gmail.com]. Examples:

link_to "Help", { :action => "help" }, :popup => true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Document #:nodoc:
attr_reader :root

# Create a new Document from the given text.
def initialize(text, strict=false)
def initialize(text, strict=false, xml=false)
tokenizer = Tokenizer.new(text)
@root = Node.new(nil)
node_stack = [ @root ]
Expand All @@ -38,7 +38,7 @@ def initialize(text, strict=false)
EOF
strict ? raise(msg) : warn(msg)
end
elsif !node.childless? && node.closing != :close
elsif !node.childless?(xml) && node.closing != :close
node_stack.push node
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ def [](attr)
end

# Returns non-+nil+ if this tag can contain child nodes.
def childless?
def childless?(xml = false)
return false if xml && @closing.nil?
!@closing.nil? ||
@name =~ /^(img|br|hr|link|meta|area|base|basefont|
col|frame|input|isindex|param)$/ox
Expand Down

0 comments on commit bfdb437

Please sign in to comment.