Closed rrichardson closed 13 years ago
do you have the newest versions of slim and temple? Can you please post the html code somewhere and the error log?
I gem installed slim, don't think I got temple, will check.
Okay. I gem installed temple and slim (so they're the latest that rubygems offers, but possibly not the latest.) I still have the exact same error. I'm not terribly familiar with sinatra, but the frustrating thing at this point is I that I'm told that: "This page contains the following errors: error on line 2 at column 645: Opening and ending tag mismatch: link line 0 and head"
But I don't even know what "this page" is. Any tips for debugging this?
where does this error occur? Is it a html error reported by the browser? Can you please post the html source code then somewhere?
Pasted the entire error page to: https://gist.github.com/671138
This occurs when I point the browser to a brand new instance of the wiki after following the directions in the README.
I am running ruby 1.9.2p0
could be a problem with nokogiri. Which version do you have?
1.4.3.1
I did have an outdated libxml which caused problems for nokogiri, originally, but I have updated to the latest and reinstalled the gem.
I think I've deciphered the outputted html and spotted the error, but I don't reckon I know of its source. all of the tags are being generated without closing tags. I'm sure you've already spotted this, but I'm a tad slow.
i typed link tags in angle brackets, but it was filtered. Either way.. all link tags are being generated without closing tags.
with this in mind, I see that it is Chrome that is complaining. Running in IE seems to render, however, then when I attempt to edit a page. When I click Save, or Save and Close. It gives me a popup saying "Are you sure you want to navigate away from this page? Content will not be saved"
You can try to patch application.rb to fix the problem with chrome.
Line 91 in application.rb - replace with this
# Layout hook which parses xml and calls layout_doc hook
hook :render, 1000 do |name, xml, layout|
doc = layout ? XMLDocument(xml) : XMLFragment(xml)
invoke_hook :dom, name, doc, layout
# FIXME: Nokogiri bug #339 - duplicate xml:lang attribute
doc.xpath('//*[@lang]').each {|elem| elem.delete('xml:lang') }
doc.xpath('//*[@xmlns]').each {|elem| elem.delete('xmlns') }
#options = Nokogiri::XML::Node::SaveOptions::AS_XHTML |
# Nokogiri::XML::Node::SaveOptions::NO_EMPTY_TAGS |
# Nokogiri::XML::Node::SaveOptions::NO_DECLARATION
#xml.replace(doc.serialize(:save_with => options))
xml.replace(doc.to_xhtml)
end
This save popup occurs only if you changed something on the page and switch the tab for example. This seems to be a jquery problem where the browsers behave differently. It works with firefox/chrome as expected. I can take a look into this.
In IE8, this problem appears regardless of whether or not the tab has been changed.
I applied the patch to application.rb and chrome complains about a different line and column. It's actually complaining about the same location, but the new XML output is better formatted than the last :)
I created a separate issue for the IE bug. This is a javascript thing and propably easy to fix.
Try this one instead of the other patch to fix the problem with invalid html
# Layout hook which parses xml and calls layout_doc hook
hook :render, 1000 do |name, xml, layout|
doc = layout ? Nokogiri::XML.parse(xml) : Nokogiri::XML::DocumentFragment.parse(xml)
invoke_hook :dom, name, doc, layout
# FIXME: Nokogiri bug <a href="/minad/olelo/issues/#issue/339" class="internal">#339</a> - duplicate xml:lang attribute
doc.xpath('//*[@lang]').each {|elem| elem.delete('xml:lang') }
doc.xpath('//*[@xmlns]').each {|elem| elem.delete('xmlns') }
xml.replace(doc.to_xhtml)
end
Ha! That worked! It now renders in Chrome.
However, I have the same problem as with IE.
It takes me to /new where I get an editing form. I set the path to Home.
Type in some content: "Welcome Home"
Click Save.
It gives me a popup which says: Confirm Navigation This page was not saved. Leave this page | Stay on this page.
I should add that leaving the page does cause it to work correctly. I guess there may not be a way around that popup.
I grabbed master and copied it to olelo in my home dir. After getting all of the required (and optional) gems, copying the config and changing the title (and also removing the modified config) I started it with unicorn and got the big pink box with this:
This page contains the following errors:
error on line 2 at column 645: Opening and ending tag mismatch: link line 0 and head Below is a rendering of the page up to the first error.
Olelo = {"path":"","page_name":"","page_new":true,"page_modified":false,"page_path":"","page_title":"Root","page_version":"","page_next_version":"","page_previous_version":"","page_mime":"text/x-creole","default_mime":"text/x-creole","user_logged_in":true,"user_name":"10.16.64.79"};My Project - New Page