aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-markdown
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-07-01 14:46:18 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-07-01 15:12:47 +0200
commit31c56c4337d47b6e0486c8ceb2815c7fa1173dcc (patch)
tree308ad19b1ccf5bdd5e6ade41d0eeba11fb9ac581 /sonar-markdown
parent5083b1202800a7ce153f1bdc3f12eea1970f9f34 (diff)
downloadsonarqube-31c56c4337d47b6e0486c8ceb2815c7fa1173dcc.tar.gz
sonarqube-31c56c4337d47b6e0486c8ceb2815c7fa1173dcc.zip
Fix quality flaws
Diffstat (limited to 'sonar-markdown')
-rw-r--r--sonar-markdown/src/main/java/org/sonar/markdown/HtmlBlockquoteChannel.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlBlockquoteChannel.java b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlBlockquoteChannel.java
index 286e7e58c80..da1594d9a30 100644
--- a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlBlockquoteChannel.java
+++ b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlBlockquoteChannel.java
@@ -47,14 +47,12 @@ class HtmlBlockquoteChannel extends Channel<MarkdownOutput> {
@Override
public boolean consume(CodeReader code, MarkdownOutput output) {
try {
- if (code.getColumnPosition() == 0) {
- if (quotedLineElement.consume(code, output)) {
- while (endOfLine.consume(code, output) && quotedLineElement.consume(code, output)) {
- // consume input
- }
- output.append("</blockquote>");
- return true;
+ if (code.getColumnPosition() == 0 && quotedLineElement.consume(code, output)) {
+ while (endOfLine.consume(code, output) && quotedLineElement.consume(code, output)) {
+ // consume input
}
+ output.append("</blockquote>");
+ return true;
}
return false;
} finally {
@@ -79,15 +77,18 @@ class HtmlBlockquoteChannel extends Channel<MarkdownOutput> {
}
private int searchIndexOfFirstCharacter(CharSequence token) {
- for (int index = 0; index < token.length(); index++) {
+ int index = 0;
+ while (index < token.length()) {
if (token.charAt(index) == '&') {
index += 4;
- while (++ index < token.length()) {
+ while (index < token.length()) {
+ index ++;
if (token.charAt(index) != ' ') {
return index;
}
}
}
+ index ++;
}
return token.length() - 1;
}