epitron / redmine_ultraviolet

Advanced syntax highlighting for Redmine source code repositories (using Ultraviolet, which is based on Textmate syntax files).
Other
60 stars 20 forks source link

error 500 when viewing a markdown file #5

Open csanquer opened 13 years ago

csanquer commented 13 years ago

I have discovered this issue : When i'm trying to see a markdown file in repository tab : i have a html 500 error page:

I hope this log's part will help :

Rendering template within layouts/base
Rendering repositories/entry

ActionView::TemplateError (Oniguruma Error: target of repeat operator is not specified) on line #15 of vendor/plugins/redmine_ultraviolet/app/views/common/_file.rhtml:
12: </style>
13: 
14: <div class="uv-file">
15:   <%= syntax_highlight(filename, to_utf8(content)) %>
16: </div>
17: 
18: <% content_for :header_tags do %>

    oniguruma (1.1.0) lib/oniguruma.rb:177:in `old_initialize'
    oniguruma (1.1.0) lib/oniguruma.rb:177:in `initialize'
    textpow (0.10.1) lib/textpow/syntax.rb:216:in `new'
    textpow (0.10.1) lib/textpow/syntax.rb:216:in `match_end'
    textpow (0.10.1) lib/textpow/syntax.rb:251:in `parse_line'
    textpow (0.10.1) lib/textpow/syntax.rb:117:in `parse'
    textpow (0.10.1) lib/textpow/syntax.rb:116:in `each_line'
    textpow (0.10.1) lib/textpow/syntax.rb:116:in `parse'
    ultraviolet (0.10.2) lib/uv.rb:73:in `parse'
    vendor/plugins/redmine_ultraviolet/app/views/common/_file.rhtml:15:in `_run_rhtml_vendor47plugins47redmine_ultraviolet47app47views47common47_file46rhtml_locals_content_file_filename_object'
    app/views/repositories/entry.rhtml:11:in `_run_rhtml_app47views47repositories47entry46rhtml'

Rendering /home/redmine/redmine-www/public/500.html (500 Internal Server Error)
epitron commented 13 years ago

Thanks for reporting this...

Unfortuantely, I don't have an install right now that I can debug or test.

A simple workaround would be to put a begin/rescue around the part of code that's blowing up, so that if there's an exception, you can just render the file as plain text.

This also appears to be a bug in Ultraviolet. Perhaps the UV authors would know more about this.