Added blockquote type=cite

master
M66B 4 days ago
parent 8b68588fdd
commit b75fa34a50

@ -409,7 +409,8 @@ public class EditTextCompose extends FixedEditText {
h = "<div>" + HtmlHelper.formatPlainText(t.toString(), false) + "</div>";
}
String style = HtmlHelper.getQuoteStyle("", 0, 0);
String html = "<blockquote style=\"" + style + "\">" + h + "</blockquote>";
String type = HtmlHelper.getQuoteType();
String html = "<blockquote style=\"" + style + "\" type=\"" + type + "\">" + h + "</blockquote>";
Helper.getUIExecutor().submit(new RunnableEx("pasteq") {
@Override

@ -1236,7 +1236,9 @@ public class EntityRule {
if (quote) {
String style = e.attr("style");
style = HtmlHelper.mergeStyles(style, HtmlHelper.getQuoteStyle(e));
e.tagName("blockquote").attr("style", style);
e.tagName("blockquote")
.attr("style", style)
.attr("type", HtmlHelper.getQuoteType());
} else
e.tagName("p");
div.appendChild(e);

@ -6388,7 +6388,9 @@ public class FragmentCompose extends FragmentBase {
if (quote) {
String style = e.attr("style");
style = HtmlHelper.mergeStyles(style, HtmlHelper.getQuoteStyle(e));
e.tagName("blockquote").attr("style", style);
e.tagName("blockquote")
.attr("style", style)
.attr("type", HtmlHelper.getQuoteType());
} else
e.tagName("p");
reply.appendChild(e);

@ -153,7 +153,7 @@ public class HtmlEx {
if (span instanceof QuoteSpan)
out.append("<blockquote style=\"")
.append(eu.faircode.email.HtmlHelper.getQuoteStyle(text, next, end))
.append("\">");
.append("\" type=\"" + HtmlHelper.getQuoteType() + "\">");
else if (span instanceof eu.faircode.email.IndentSpan)
out.append("<blockquote style=\"")
.append(eu.faircode.email.HtmlHelper.getIndentStyle(text, next, end))

@ -2341,7 +2341,7 @@ public class HtmlHelper {
if (tlevel > level)
sb.append("<blockquote style=\"")
.append(getQuoteStyle(line, 0, line.length()))
.append("\">");
.append("\" type=\"" + HtmlHelper.getQuoteType() + "\">");
line = line.substring(1); // >
@ -2758,6 +2758,11 @@ public class HtmlHelper {
return "border-" + dir + ":3px solid #ccc; padding-" + dir + ":10px;margin:0;";
}
static String getQuoteType() {
// https://github.com/mozilla-firefox/firefox/blob/aaf0207c409c5f6479cc92bc1bf407a453d63cdc/editor/libeditor/HTMLEditUtils.cpp#L804
return "cite"; // Non standard
}
static String getIndentStyle(CharSequence quoted, int start, int end) {
return "margin-top:0; margin-bottom:0;";
}

Loading…
Cancel
Save