Merge fb94ad2fd4d31e773068533e6f94d4502a7e0d39 into 2ea148c30a07f91ffa37c0aa36af1cf2670441af

This commit is contained in:
张宇 2023-06-27 04:40:01 +00:00 committed by GitHub
commit c09f97aa1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -40,7 +40,8 @@ public class HtmlCssStyleParserSample extends MarkwonTextViewSample {
final String md = "# CSS\n\n" +
"<span style=\"background-color: #ff0000;\">this has red background</span> and then\n\n" +
"this <span style=\"color: #00ff00;\">is green</span>";
"this <span style=\"color: #00ff00;\">is green</span>\n\n" +
"<span style=\"color: red;\">A <span style=\"color: blue;\">blue</span> inside the red</span>";
final Markwon markwon = Markwon.builder(context)
.usePlugin(HtmlPlugin.create(plugin -> plugin.addHandler(new SpanTagHandler())))
@ -68,7 +69,7 @@ public class HtmlCssStyleParserSample extends MarkwonTextViewSample {
case "color":
color = Color.parseColor(property.value());
break;
case "background":
case "background-color":
backgroundColor = Color.parseColor(property.value());
break;

View File

@ -193,7 +193,10 @@ public class MarkwonHtmlParserImpl extends MarkwonHtmlParser {
}
}
action.apply(Collections.unmodifiableList((List<? extends HtmlTag.Inline>) inlineTags));
List<HtmlTag.Inline> reverseOrder =
new ArrayList<>((List<? extends HtmlTag.Inline>) inlineTags);
Collections.reverse(reverseOrder);
action.apply(reverseOrder);
inlineTags.clear();
} else {
action.apply(Collections.<HtmlTag.Inline>emptyList());