HTML escaping of dashboard results#26
Conversation
|
@ethomson Apologies for the ping, but is there any chance you could take a look at this? I want to integrate this into a Ruby/RSpec project, which generates a lot of stack traces like: ActiveRecord::RecordInvalid:
Validation failed: Name is too long (maximum is 30 characters)
./spec/models/foo_spec.rb:32:in `block (2 levels) in <main>'Basically all test failures will contain that |
|
Actually, it looks like this problem is a bit deeper even. We also have quite verbose test failures, which can include things like diffs between models. This leads to output such as this: This renders fine in a triple-backtick code block, but GitHub seems to want to parse it as Markdown inside update: I did some digging, and it looks like GitHub-Flavored Markdown won't actually disable the Markdown parser inside <tr><td><pre><code>test
details
here</code></pre></td></tr>For GitHub to properly parse this, however, it needs to appear as <tr><td>
<pre><code>test
details
here</code></pre></td></tr> |
GitHub's parser treats '<pre>' at the beginning of a line specially and will change escaping when it sees it. Cope with that reality. Fixes #26
|
Thanks for the fix and sorry for the delay! |
|
Also, thanks @BytewaveMLP for the analysis, I've included your suggestion. |
Using characters
<or>in test result names, descriptions or details will likely break rendering of the results in the dashboard.This PR adds proper HTML escaping to avoid this.
Drive-by changes:
<no name>instead ofundefinedfor tests that have no namesi18n-text/no-encomplaining about using English string literals in code.