Duga
Duga copied to clipboard
Ignore "possible answer invalidation" on block-quoted code blocks
Here is an example of where this was posted to chat:
http://chat.stackexchange.com/transcript/message/25582457#25582457
Here is a screenshot of the edit history that triggered this:
An improvement to this feature would be to ignore edits to code blocks which begins with the >
characters, and then 5 spaces: >
This would reduce the number of false-positives posted for others to review.
It would reduce the number of false-positives. Wouldn't it also reduce the number of correct positives?
meh.. usually quoted code-blocks aren't relevant to the question or only considered supplementary context for the code under review. e.g example usage.
I'd say this is a good idea
It's actually ">" and 5 spaces, not 4 :-)
Sent from my Samsung device
@retailcoder I updated the original request thx for pointing out the 5 vs 4 spaces :+1:
Looks like Duga is actually designed to parse the rendered HTML, rather than the mark-up source, so the number of spaces or >
would be irrelevant. See source code.
This means that...
<blockquote><code>
QUOTED CODE HERE
</code></blockquote>
...would need to be stripped by the stripNonCode(String post)
method, although SE renders it with a bit more HTML complexity in the edits review, for example from above edit history (select View Source)
<blockquote><span class="diff-delete">
</span><pre><code><span class="diff-delete">java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
Pattern match succeeded
</span></code></pre><span class="diff-delete">
</span></blockquote>
So perhaps instead just making it to where anything between <blockquote></blockquote>
tags is stripped, regardless if it has a <code></code>
child present or not.