(StringBuilder out, Spanned text, int start, int end,
int option)
| 136 | } |
| 137 | |
| 138 | private /* static */ void withinDiv(StringBuilder out, Spanned text, int start, int end, |
| 139 | int option) { |
| 140 | int next; |
| 141 | for (int i = start; i < end; i = next) { |
| 142 | int n1 = nextSpanTransition(text, i, end, QuoteSpan.class); |
| 143 | int n2 = nextSpanTransition(text, i, end, eu.faircode.email.IndentSpan.class); |
| 144 | next = Math.min(n1, n2); |
| 145 | try { |
| 146 | List<Object> spans = new ArrayList<>(); |
| 147 | for (Object span : getSpans(text, i, next, LeadingMarginSpan.class)) |
| 148 | if (span instanceof QuoteSpan || |
| 149 | span instanceof eu.faircode.email.IndentSpan) |
| 150 | spans.add(span); |
| 151 | |
| 152 | for (Object span : spans) { |
| 153 | if (span instanceof QuoteSpan) |
| 154 | out.append("<blockquote style=\"") |
| 155 | .append(eu.faircode.email.HtmlHelper.getQuoteStyle(text, next, end)) |
| 156 | .append("\">"); |
| 157 | else if (span instanceof eu.faircode.email.IndentSpan) |
| 158 | out.append("<blockquote style=\"") |
| 159 | .append(eu.faircode.email.HtmlHelper.getIndentStyle(text, next, end)) |
| 160 | .append("\">"); |
| 161 | } |
| 162 | |
| 163 | withinBlockquote(out, text, i, next, option); |
| 164 | |
| 165 | for (Object span : spans) { |
| 166 | out.append("</blockquote>\n"); |
| 167 | } |
| 168 | } catch (Throwable ex) { |
| 169 | Log.e("withinDiv " + start + "..." + end + "/" + text.length() + |
| 170 | " i=" + i + " n1=" + n1 + " n2=" + n2 + |
| 171 | "\n" + android.util.Log.getStackTraceString(ex)); |
| 172 | throw ex; |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | private /* static */ String getTextDirection(Spanned text, int start, int end) { |
| 178 | try { |
no test coverage detected