https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292016-05-30T10:51:14ZRedmineRedmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=711582016-05-30T10:51:14ZJan from Planio www.plan.io
<ul><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>90</i></li></ul> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=711602016-05-30T10:51:44ZJan from Planio www.plan.io
<ul><li><strong>Blocked by</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/22898">Patch #22898</a>: !>image.png! generates invalid HTML</i> added</li></ul> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=711732016-05-31T00:54:09ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/16324">Feature #16324</a>: Wiki export as docx file.</i> added</li></ul> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=711882016-05-31T08:52:20ZJan from Planio www.plan.io
<ul><li><strong>Related to</strong> deleted (<i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/16324">Feature #16324</a>: Wiki export as docx file.</i>)</li></ul> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=711912016-05-31T08:52:21ZJan from Planio www.plan.io
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/16324">Feature #16324</a>: Wiki export as docx file.</i> added</li></ul> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=712752016-06-06T01:00:56ZGo MAEDA
<ul><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>3.3.0</i></li></ul><p>I tested this patch with LibreOffice Mac and Word 2016 for Mac, works fine. I think it is very useful to write documents based on wiki contents.</p>
<p>@Jan-Philippe, could this be included in 3.3.0?</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=712912016-06-06T10:30:08ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>File</strong> <a href="/attachments/16091">HowTo_Install_Redmine_212_in_Ubuntu_1210_and_Apache_Passenger.txt</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/16091/HowTo_Install_Redmine_212_in_Ubuntu_1210_and_Apache_Passenger.txt">HowTo_Install_Redmine_212_in_Ubuntu_1210_and_Apache_Passenger.txt</a> added</li><li><strong>File</strong> <a href="/attachments/16092">HowTo_Install_Redmine_212_in_Ubuntu_1210_and_Apache_Passenger.odt</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/16092/HowTo_Install_Redmine_212_in_Ubuntu_1210_and_Apache_Passenger.odt">HowTo_Install_Redmine_212_in_Ubuntu_1210_and_Apache_Passenger.odt</a> added</li></ul><p>I tested the patch on a copy of the Redmine wiki:</p>
<ul>
<li>exporting the whole wiki doesn't respond/is too slow (had to kill ruby after 15 minutes), we should probably disable this option. In comparaison, exporting every pages individually took about 2 minutes.</li>
<li>some pages generate documents that seem invalid (at least for Word 2007 that complains about an unspecified error when opening the generated odt)</li>
<li>some pages that contain URLs trigger this kind of error (seems to be caused by examples URLs that are not valid URLs):</li>
</ul>
<pre>
ActionView::Template::Error (the scheme http does not accept registry part: proxy.domain.tld:port (or bad hostname?)):
1: <%= raw wiki_page_to_odt(@page, @project) %>
c:/utils/ruby/lib/ruby/2.0.0/uri/generic.rb:1203:in `rescue in merge'
c:/utils/ruby/lib/ruby/2.0.0/uri/generic.rb:1200:in `merge'
html2odt (0.3.0) lib/html2odt/document.rb:270:in `block in fix_links'
nokogiri-1.6.7.2-x86 (mingw32) lib/nokogiri/xml/node_set.rb:187:in `block in each'
nokogiri-1.6.7.2-x86 (mingw32) lib/nokogiri/xml/node_set.rb:186:in `upto'
nokogiri-1.6.7.2-x86 (mingw32) lib/nokogiri/xml/node_set.rb:186:in `each'
html2odt (0.3.0) lib/html2odt/document.rb:269:in `fix_links'
html2odt (0.3.0) lib/html2odt/document.rb:209:in `prepare_html'
html2odt (0.3.0) lib/html2odt/document.rb:55:in `content_xml'
html2odt (0.3.0) lib/html2odt/document.rb:142:in `block (4 levels) in data'
rubyzip (1.2.0) lib/zip/entry.rb:495:in `get_input_stream'
html2odt (0.3.0) lib/html2odt/document.rb:139:in `block (3 levels) in data'
</pre>
<p>I attached a raw wiki page content. When formatting is set to Markdown, you should get the error, when formatting is set to textile, you should get the invalid odt (which is also attached).</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=712932016-06-06T10:36:20ZJan from Planio www.plan.io
<ul></ul><blockquote>
<p>I tested the patch on a copy of the Redmine wiki:</p>
</blockquote>
<p>Thank you for testing it. The long response times seem quite odd. It works quite fast (also with larger wikis) for us. For comparison, you could try on a <a href="https://accounts.plan.io/signup/Bronze" class="external">new Planio account</a>, we already have this running in production.</p>
<p>We hadn't tested it on Windows though which it seems you have used for your tests, correct?</p>
<p>We will look into it and try to reproduce/fix these problems. Thanks again!</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=712992016-06-06T10:51:45ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Jan from Planio <a class="external" href="http://www.plan.io">www.plan.io</a> wrote:</p>
<blockquote>
<p>We hadn't tested it on Windows though which it seems you have used for your tests, correct?</p>
</blockquote>
<p>Correct, ruby 2.0.0p481 (2014-05-08) [i386-mingw32]</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=713192016-06-06T14:34:29ZGregor Schmidtschmidt@nach-vorne.eu
<ul><li><strong>File</strong> <a href="/attachments/16104">Wiki.txt</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/16104/Wiki.txt">Wiki.txt</a> added</li></ul><p>Thanks a lot for testing this patch/feature.</p>
<p>I have just set up a Windows development machine to verify your feedback:</p>
<blockquote>
<ul>
<li>exporting the whole wiki doesn't respond/is too slow (had to kill ruby after 15 minutes), we should probably disable this option. In comparaison, exporting every pages individually took about 2 minutes.</li>
</ul>
</blockquote>
<p>This is very surprising. On my newly set up development virtual machine (on 5 year old Macbook) running Windows 7 and Ruby 2.0 (using Ruby Installer), the example wiki page you provided was generated within 0.4 seconds. This also matches my experience on Mac OS and Linux.</p>
<blockquote>
<ul>
<li>some pages generate documents that seem invalid (at least for Word 2007 that complains about an unspecified error when opening the generated odt)</li>
</ul>
</blockquote>
<p>Unfortunately this is true. <code>xhtml2odt</code> claims to handle only valid XHTML and we have already encountered cases where even valid HTML was not handled in the expected way. <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: !>image.png! generates invalid HTML (Closed)" href="https://www.redmine.org/issues/22898">#22898</a> was one such case, the given example document is another. Attached you may find an updated one. All I did, was added new lines around the <code>pre</code> tags, so that they are not entangled with the previous paragraph. But since we cannot expect the user to write perfectly formatted content, I will have a look at how I can fix the problem at hand in any case. I just wanted to let you know about the underlying reason.</p>
<blockquote>
<ul>
<li>some pages that contain URLs trigger this kind of error (seems to be caused by examples URLs that are not valid URLs)</li>
</ul>
</blockquote>
<p>Thank you for this bug report. Indeed, handling of invalid URIs was missing in <code>html2odt</code>. The latest release (0.3.1) fixes that. Running <code>bundle update html2odt</code> should add it to your installation.</p>
<hr />
<p>I will have a look, at how I can handle the markup generated on your example content.</p>
<p>Could you try to narrow down, why generating the ODT is so slow on your machine? Should we gather more feedback by other developers? What do you think?</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=713532016-06-07T13:23:37ZGregor Schmidtschmidt@nach-vorne.eu
<ul></ul><p>We have just released html2odt v0.3.3, which addresses all problems, that came up during your tests.</p>
<p>The only problem remaining would be the speed issues, you saw. But I am afraid, that I cannot isolate and reproduce those without further input.</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=714562016-06-12T10:11:07ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>File</strong> <a href="/attachments/16135">redmine.odt</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/16135/redmine.odt">redmine.odt</a> added</li><li><strong>Target version</strong> deleted (<del><i>3.3.0</i></del>)</li></ul><p>Gregor Schmidt wrote:</p>
<blockquote>
<p>This is very surprising. On my newly set up development virtual machine (on 5 year old Macbook) running Windows 7 and Ruby 2.0 (using Ruby Installer), the example wiki page you provided was generated within 0.4 seconds. This also matches my experience on Mac OS and Linux.</p>
</blockquote>
<p>Yes, I had good response times when exporting signle wiki pages, as I mentioned before. The problem was when exporting the whole wiki in one ODT file (by using the export link on the wiki page index). This was not a Windows issue as I get the same behaviour when testing under linux (I let it run for more than one hour before killing webrick).</p>
<p>This problem no longer occurs with the same wiki content and html2odt 0.3.3 so I guess it was a html2odt or nokogiri issue (html2odt 0.3.3 uses a different nokogiri version). Now I get the whole wiki export in a minute (with both windows and linux) but the resulting ODT seems to be invalid. You'll find it attached.</p>
<p>This feature seems to be usefull for a very few users and I prefer not to add it to the core. But I'd be happy to refactor a few things in order to make it easier for plugins to add new export formats, without having to patch views and controllers.</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=714602016-06-12T10:49:47ZGregor Schmidtschmidt@nach-vorne.eu
<ul></ul><p>Thanks again for taking the time to review and test the changes and for giving such detailed feedback. This is very much appreciated.</p>
<p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>This problem no longer occurs with the same wiki content and html2odt 0.3.3 so I guess it was a html2odt or nokogiri issue (html2odt 0.3.3 uses a different nokogiri version). Now I get the whole wiki export in a minute (with both windows and linux) but the resulting ODT seems to be invalid. You'll find it attached.</p>
</blockquote>
<p>Thanks for the feedback. I am not aware of speed related improvements in html2odt - at least I was not aiming for them. But I am glad, that it's working better now.</p>
<p>Thanks for providing the ODT. I'll have a look and see if I can isolate the root cause of the error.</p>
<blockquote>
<p>This feature seems to be usefull for a very few users and I prefer not to add it to the core.</p>
</blockquote>
<p>I am sorry to hear that, but I can totally understand your decision.</p>
<blockquote>
<p>But I'd be happy to refactor a few things in order to make it easier for plugins to add new export formats, without having to patch views and controllers.</p>
</blockquote>
<p>That would be great. We would be happy to create a plugin with the same features. If Redmine had some kind of export registry, we could easily hook into that.</p>
<p>We are looking forward to those changes. Let me know if you would like to us to help with those refactorings.</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=714622016-06-12T13:37:49ZGregor Schmidtschmidt@nach-vorne.eu
<ul><li><strong>File</strong> <i>0001-Add-ODT-export-for-wiki-pages.patch</i> added</li></ul><p>Thanks again for providing the erroneous ODT. Now that I see, that it is more than 800 pages long, I can imagine, why it's taking a minute to generate. I assume, the PDF export would not be a lot faster.</p>
<p>Concerning the ODT error, I was able to identify the root cause. It is related to the HTML generated by the collapse macro. The error was located in the export of <a href="/projects/redmine/wiki/InstallRedmineOnDebianStableApacheMysqlPassenger">this wiki page</a>.</p>
<p>Attached you may find an updated patch<sup><a href="#fn1">1</a></sup>, which further cleans up the HTML before handing it over to <code>html2odt</code>. I am leaving this here for future reference.</p>
<p id="fn1" class="footnote"><sup>1</sup> replacing the first one</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=717572016-06-24T06:04:44ZJan from Planio www.plan.io
<ul><li><strong>File</strong> deleted (<del><i>0001-Add-ODT-export-for-wiki-pages.patch</i></del>)</li></ul> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=717652016-06-24T12:20:51ZGregor Schmidtschmidt@nach-vorne.eu
<ul><li><strong>File</strong> <a href="/attachments/16242">0001-Add-ODT-export-for-wiki-pages.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/16242/0001-Add-ODT-export-for-wiki-pages.patch">0001-Add-ODT-export-for-wiki-pages.patch</a> added</li></ul><p>Previous versions of the patch contained a path traversal vulnerability, which allowed attackers to access image files outside of <code>Rails.public_path</code>. Attached you may find an updated patch, including the fix.</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=717662016-06-24T12:27:30ZJan from Planio www.plan.io
<ul><li><strong>File</strong> deleted (<del><i>0001-Add-ODT-export-for-wiki-pages.patch</i></del>)</li></ul> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=724382016-07-27T15:39:19ZAntonín Heřmánek
<ul></ul><p>Wiki pages are converted without images. Runing on Debian stable, ruby 2.1.5, redmine 3.1.1</p> Redmine - Feature #22923: Export Wiki to ODThttps://www.redmine.org/issues/22923?journal_id=854092018-06-05T15:24:22Zfilippo mandelli
<ul></ul><p>I install patch in my Redmine installation. In case of images inside wiki page, in the ODT file the images are missing.</p>