minad / olelo

Wiki with git backend
MIT License
241 stars 44 forks source link

unclosed tags causes olelo to hang #40

Closed cout closed 13 years ago

cout commented 13 years ago

If I mistakenly use an html 1.0 tag in a wiki page such as:

<br>

instead of the proper xhtml tag:

<br/>

then olelo hangs in tag.rb. A quick fix that keeps olelo from hanging (but unfortunately does not infer what the user meant):

diff --git a/plugins/filter/tag.rb b/plugins/filter/tag.rb
index 2613ed8..d2ec8a7 100644
--- a/plugins/filter/tag.rb
+++ b/plugins/filter/tag.rb
@@ -95,7 +95,7 @@ class TagSoupParser
   def get_content
     stack = [@name]
     text = ''
-    while !stack.empty?
+    while !stack.empty? and !@content.empty?
       case @content
       # Tag begins
       when /\A<(#{NAME})/
minad commented 13 years ago

fixed in d8006630aecc6bf3fbaad6f83415eb1e2a2bfc1f. autoclosing tags support in 7343fecbe5e0a9cb051fd3bbffa89ffdce17b2fa