Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore "possible answer invalidation" on block-quoted code blocks #112

Open
Phrancis opened this issue Nov 21, 2015 · 5 comments
Open

Ignore "possible answer invalidation" on block-quoted code blocks #112

Phrancis opened this issue Nov 21, 2015 · 5 comments

Comments

@Phrancis
Copy link

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:

screen shot 2015-11-20 at 11 05 53 pm

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.

@ShipsWithCannons
Copy link

It would reduce the number of false-positives. Wouldn't it also reduce the number of correct positives?

@Vogel612
Copy link
Contributor

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

@retailcoder
Copy link

It's actually ">" and 5 spaces, not 4 :-)

Sent from my Samsung device

@Phrancis
Copy link
Author

@retailcoder I updated the original request thx for pointing out the 5 vs 4 spaces 👍

@Phrancis
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants