1174 lines
40 KiB
Smali
1174 lines
40 KiB
Smali
.class public final Lcom/discord/utilities/textprocessing/Parsers;
|
|
.super Ljava/lang/Object;
|
|
.source "Parsers.kt"
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/utilities/textprocessing/Parsers;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/utilities/textprocessing/Parsers;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/textprocessing/Parsers;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/textprocessing/Parsers;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final createMarkdownRules(Landroid/content/Context;)Ljava/util/List;
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<RC:",
|
|
"Ljava/lang/Object;",
|
|
"S:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Landroid/content/Context;",
|
|
")",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/simpleast/core/parser/Rule<",
|
|
"TRC;",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TRC;>;TS;>;>;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x3
|
|
|
|
new-array v0, v0, [Lcom/discord/simpleast/core/parser/Rule$BlockRule;
|
|
|
|
new-instance v1, Le/a/g/b/a$c;
|
|
|
|
sget-object v2, Lcom/discord/utilities/textprocessing/Spans;->INSTANCE:Lcom/discord/utilities/textprocessing/Spans;
|
|
|
|
invoke-virtual {v2, p1}, Lcom/discord/utilities/textprocessing/Spans;->createHeaderStyleSpanProvider(Landroid/content/Context;)Lkotlin/jvm/functions/Function1;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v2}, Le/a/g/b/a$c;-><init>(Lkotlin/jvm/functions/Function1;)V
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
new-instance v1, Lcom/discord/utilities/textprocessing/Rules$HeaderLineClassedRule;
|
|
|
|
sget-object v2, Lcom/discord/utilities/textprocessing/Spans;->INSTANCE:Lcom/discord/utilities/textprocessing/Spans;
|
|
|
|
invoke-virtual {v2, p1}, Lcom/discord/utilities/textprocessing/Spans;->createHeaderPaddingSpansProvider(Landroid/content/Context;)Lkotlin/jvm/functions/Function0;
|
|
|
|
move-result-object v2
|
|
|
|
sget-object v3, Lcom/discord/utilities/textprocessing/Spans;->INSTANCE:Lcom/discord/utilities/textprocessing/Spans;
|
|
|
|
invoke-virtual {v3, p1}, Lcom/discord/utilities/textprocessing/Spans;->createHeaderStyleSpanProvider(Landroid/content/Context;)Lkotlin/jvm/functions/Function1;
|
|
|
|
move-result-object v3
|
|
|
|
sget-object v4, Lcom/discord/utilities/textprocessing/Spans;->INSTANCE:Lcom/discord/utilities/textprocessing/Spans;
|
|
|
|
invoke-virtual {v4, p1}, Lcom/discord/utilities/textprocessing/Spans;->createHeaderClassSpanProvider(Landroid/content/Context;)Lkotlin/jvm/functions/Function1;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-direct {v1, v2, v3, v4}, Lcom/discord/utilities/textprocessing/Rules$HeaderLineClassedRule;-><init>(Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
new-instance v1, Lcom/discord/utilities/textprocessing/Rules$MarkdownListItemRule;
|
|
|
|
sget-object v2, Lcom/discord/utilities/textprocessing/Spans;->INSTANCE:Lcom/discord/utilities/textprocessing/Spans;
|
|
|
|
invoke-virtual {v2, p1}, Lcom/discord/utilities/textprocessing/Spans;->createMarkdownBulletSpansProvider(Landroid/content/Context;)Lkotlin/jvm/functions/Function0;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v1, p1}, Lcom/discord/utilities/textprocessing/Rules$MarkdownListItemRule;-><init>(Lkotlin/jvm/functions/Function0;)V
|
|
|
|
const/4 p1, 0x2
|
|
|
|
aput-object v1, v0, p1
|
|
|
|
invoke-static {v0}, Le/k/a/c/e/p/g;->listOf([Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public static final createParser(ZZ)Lcom/discord/simpleast/core/parser/Parser;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(ZZ)",
|
|
"Lcom/discord/simpleast/core/parser/Parser<",
|
|
"Lcom/discord/utilities/textprocessing/MessageRenderContext;",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"Lcom/discord/utilities/textprocessing/MessageRenderContext;",
|
|
">;",
|
|
"Lcom/discord/utilities/textprocessing/MessageParseState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-direct {v0, v1, v2, v3}, Lcom/discord/simpleast/core/parser/Parser;-><init>(ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sget-object v1, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/textprocessing/Rules;->createSoftHyphenRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object v1, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/textprocessing/Rules;->createBlockQuoteRule()Lcom/discord/simpleast/core/parser/Rule$BlockRule;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object v1, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/textprocessing/Rules;->createCodeBlockRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object v1, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/textprocessing/Rules;->createInlineCodeRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object v1, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/textprocessing/Rules;->createSpoilerRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/textprocessing/Rules;->createMaskedLinkRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
:cond_0
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/textprocessing/Rules;->createUrlNoEmbedRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/textprocessing/Rules;->createUrlRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/textprocessing/Rules;->createCustomEmojiRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/textprocessing/Rules;->createNamedEmojiRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/textprocessing/Rules;->createUnescapeEmoticonRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/textprocessing/Rules;->createChannelMentionRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/textprocessing/Rules;->createRoleMentionRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/textprocessing/Rules;->createUserMentionRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
:cond_1
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/textprocessing/Rules;->createUnicodeEmojiRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
sget-object p0, Lcom/discord/utilities/textprocessing/Parsers;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers;
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/textprocessing/Parsers;->getBasicRules()Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/simpleast/core/parser/Parser;->addRules(Ljava/util/Collection;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getBasicRules()Ljava/util/List;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/simpleast/core/parser/Rule<",
|
|
"Lcom/discord/utilities/textprocessing/MessageRenderContext;",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"Lcom/discord/utilities/textprocessing/MessageRenderContext;",
|
|
">;",
|
|
"Lcom/discord/utilities/textprocessing/MessageParseState;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {v0}, Le/a/g/a/b/a;->a(Z)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/textprocessing/Rules;->createTextReplacementRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final parseBoldMarkdown(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
|
.locals 9
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
new-instance v1, Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-direct {v1, v2, v3, v0}, Lcom/discord/simpleast/core/parser/Parser;-><init>(ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sget-object v2, Le/a/g/a/b/a;->h:Le/a/g/a/b/a;
|
|
|
|
invoke-virtual {v2}, Le/a/g/a/b/a;->b()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Le/a/g/a/b/a;->h:Le/a/g/a/b/a;
|
|
|
|
invoke-virtual {v2}, Le/a/g/a/b/a;->a()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Le/a/g/a/b/a;->h:Le/a/g/a/b/a;
|
|
|
|
invoke-virtual {v2}, Le/a/g/a/b/a;->f()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object v3
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x4
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move-object v4, p0
|
|
|
|
invoke-static/range {v3 .. v8}, Lcom/discord/simpleast/core/parser/Parser;->parse$default(Lcom/discord/simpleast/core/parser/Parser;Ljava/lang/CharSequence;Ljava/lang/Object;Ljava/util/List;ILjava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0, v0}, Lcom/discord/utilities/textprocessing/AstRenderer;->render(Ljava/util/Collection;Ljava/lang/Object;)Lcom/facebook/drawee/span/DraweeSpanStringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "AstRenderer.render(ast, null)"
|
|
|
|
invoke-static {p0, v0}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const-string p0, "input"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static final parseHookedLinks(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
|
.locals 9
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
new-instance v1, Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-direct {v1, v2, v3, v0}, Lcom/discord/simpleast/core/parser/Parser;-><init>(ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sget-object v2, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/utilities/textprocessing/Rules;->createSoftHyphenRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/utilities/textprocessing/Rules;->createNonMarkdownRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/utilities/textprocessing/Rules;->createHookedLinkRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Le/a/g/a/b/a;->h:Le/a/g/a/b/a;
|
|
|
|
invoke-virtual {v2}, Le/a/g/a/b/a;->a()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Le/a/g/a/b/a;->h:Le/a/g/a/b/a;
|
|
|
|
invoke-virtual {v2}, Le/a/g/a/b/a;->f()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object v3
|
|
|
|
sget-object v5, Lkotlin/Unit;->a:Lkotlin/Unit;
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x4
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move-object v4, p0
|
|
|
|
invoke-static/range {v3 .. v8}, Lcom/discord/simpleast/core/parser/Parser;->parse$default(Lcom/discord/simpleast/core/parser/Parser;Ljava/lang/CharSequence;Ljava/lang/Object;Ljava/util/List;ILjava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0, v0}, Lcom/discord/utilities/textprocessing/AstRenderer;->render(Ljava/util/Collection;Ljava/lang/Object;)Lcom/facebook/drawee/span/DraweeSpanStringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "AstRenderer.render(ast, null)"
|
|
|
|
invoke-static {p0, v0}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const-string p0, "input"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static synthetic parseMarkdown$default(Lcom/discord/utilities/textprocessing/Parsers;Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
.locals 1
|
|
|
|
and-int/lit8 p6, p5, 0x4
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p6, :cond_0
|
|
|
|
move-object p3, v0
|
|
|
|
:cond_0
|
|
and-int/lit8 p5, p5, 0x8
|
|
|
|
if-eqz p5, :cond_1
|
|
|
|
move-object p4, v0
|
|
|
|
:cond_1
|
|
invoke-virtual {p0, p1, p2, p3, p4}, Lcom/discord/utilities/textprocessing/Parsers;->parseMarkdown(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;Ljava/lang/Integer;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final parseMaskedLinks(Landroid/content/Context;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
|
.locals 7
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/16 v5, 0x1c
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v1, p1
|
|
|
|
invoke-static/range {v0 .. v6}, Lcom/discord/utilities/textprocessing/Parsers;->parseMaskedLinks$default(Landroid/content/Context;Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Ljava/lang/Integer;ILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final parseMaskedLinks(Landroid/content/Context;Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function2;)Ljava/lang/CharSequence;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/Context;",
|
|
"Ljava/lang/CharSequence;",
|
|
"Lkotlin/jvm/functions/Function2<",
|
|
"-",
|
|
"Landroid/content/Context;",
|
|
"-",
|
|
"Ljava/lang/String;",
|
|
"Lkotlin/Unit;",
|
|
">;)",
|
|
"Ljava/lang/CharSequence;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/16 v5, 0x18
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v1, p1
|
|
|
|
move-object v2, p2
|
|
|
|
invoke-static/range {v0 .. v6}, Lcom/discord/utilities/textprocessing/Parsers;->parseMaskedLinks$default(Landroid/content/Context;Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Ljava/lang/Integer;ILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final parseMaskedLinks(Landroid/content/Context;Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;)Ljava/lang/CharSequence;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/Context;",
|
|
"Ljava/lang/CharSequence;",
|
|
"Lkotlin/jvm/functions/Function2<",
|
|
"-",
|
|
"Landroid/content/Context;",
|
|
"-",
|
|
"Ljava/lang/String;",
|
|
"Lkotlin/Unit;",
|
|
">;",
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"-",
|
|
"Ljava/lang/String;",
|
|
"Lkotlin/Unit;",
|
|
">;)",
|
|
"Ljava/lang/CharSequence;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/16 v5, 0x10
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v1, p1
|
|
|
|
move-object v2, p2
|
|
|
|
move-object v3, p3
|
|
|
|
invoke-static/range {v0 .. v6}, Lcom/discord/utilities/textprocessing/Parsers;->parseMaskedLinks$default(Landroid/content/Context;Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Ljava/lang/Integer;ILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final parseMaskedLinks(Landroid/content/Context;Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Ljava/lang/Integer;)Ljava/lang/CharSequence;
|
|
.locals 10
|
|
.param p4 # Ljava/lang/Integer;
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/Context;",
|
|
"Ljava/lang/CharSequence;",
|
|
"Lkotlin/jvm/functions/Function2<",
|
|
"-",
|
|
"Landroid/content/Context;",
|
|
"-",
|
|
"Ljava/lang/String;",
|
|
"Lkotlin/Unit;",
|
|
">;",
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"-",
|
|
"Ljava/lang/String;",
|
|
"Lkotlin/Unit;",
|
|
">;",
|
|
"Ljava/lang/Integer;",
|
|
")",
|
|
"Ljava/lang/CharSequence;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {v2, v1}, Le/a/g/a/b/a;->a(ZI)Ljava/util/List;
|
|
|
|
move-result-object v9
|
|
|
|
sget-object v3, Lcom/discord/utilities/textprocessing/Parsers;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers;
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x4
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move-object v4, v9
|
|
|
|
move-object v5, p4
|
|
|
|
invoke-static/range {v3 .. v8}, Lcom/discord/utilities/textprocessing/Parsers;->updateSimpleRulesCustomColors$default(Lcom/discord/utilities/textprocessing/Parsers;Ljava/util/List;Ljava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)V
|
|
|
|
new-instance p4, Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
invoke-direct {p4, v2, v1, v0}, Lcom/discord/simpleast/core/parser/Parser;-><init>(ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sget-object v0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/textprocessing/Rules;->createSoftHyphenRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p4, v0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p4
|
|
|
|
sget-object v0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/textprocessing/Rules;->createMaskedLinkRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p4, v0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p4
|
|
|
|
sget-object v0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/textprocessing/Rules;->createUrlNoEmbedRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p4, v0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p4
|
|
|
|
sget-object v0, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/textprocessing/Rules;->createUrlRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p4, v0}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {p4, v9}, Lcom/discord/simpleast/core/parser/Parser;->addRules(Ljava/util/Collection;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v2, Lkotlin/Unit;->a:Lkotlin/Unit;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x4
|
|
|
|
const/4 v5, 0x0
|
|
|
|
move-object v1, p1
|
|
|
|
invoke-static/range {v0 .. v5}, Lcom/discord/simpleast/core/parser/Parser;->parse$default(Lcom/discord/simpleast/core/parser/Parser;Ljava/lang/CharSequence;Ljava/lang/Object;Ljava/util/List;ILjava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p4, Lcom/discord/utilities/textprocessing/Parsers$parseMaskedLinks$renderContext$1;
|
|
|
|
invoke-direct {p4, p2, p0, p3}, Lcom/discord/utilities/textprocessing/Parsers$parseMaskedLinks$renderContext$1;-><init>(Lkotlin/jvm/functions/Function2;Landroid/content/Context;Lkotlin/jvm/functions/Function1;)V
|
|
|
|
invoke-static {p1, p4}, Lcom/discord/utilities/textprocessing/AstRenderer;->render(Ljava/util/Collection;Ljava/lang/Object;)Lcom/facebook/drawee/span/DraweeSpanStringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "AstRenderer.render(ast, renderContext)"
|
|
|
|
invoke-static {p0, p1}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const-string p0, "onClickListener"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p0, "input"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
const-string p0, "context"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static synthetic parseMaskedLinks$default(Landroid/content/Context;Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Ljava/lang/Integer;ILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
.locals 0
|
|
|
|
and-int/lit8 p6, p5, 0x4
|
|
|
|
if-eqz p6, :cond_0
|
|
|
|
sget-object p2, Lcom/discord/utilities/textprocessing/Parsers$parseMaskedLinks$1;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers$parseMaskedLinks$1;
|
|
|
|
:cond_0
|
|
and-int/lit8 p6, p5, 0x8
|
|
|
|
if-eqz p6, :cond_1
|
|
|
|
new-instance p3, Lcom/discord/utilities/textprocessing/Parsers$parseMaskedLinks$2;
|
|
|
|
invoke-direct {p3, p0}, Lcom/discord/utilities/textprocessing/Parsers$parseMaskedLinks$2;-><init>(Landroid/content/Context;)V
|
|
|
|
:cond_1
|
|
and-int/lit8 p5, p5, 0x10
|
|
|
|
if-eqz p5, :cond_2
|
|
|
|
const/4 p4, 0x0
|
|
|
|
:cond_2
|
|
invoke-static {p0, p1, p2, p3, p4}, Lcom/discord/utilities/textprocessing/Parsers;->parseMaskedLinks(Landroid/content/Context;Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Ljava/lang/Integer;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final updateSimpleRulesCustomColors(Ljava/util/List;Ljava/lang/Integer;Ljava/lang/Integer;)V
|
|
.locals 6
|
|
.param p2 # Ljava/lang/Integer;
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Ljava/lang/Integer;
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<RC:",
|
|
"Ljava/lang/Object;",
|
|
"S:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/simpleast/core/parser/Rule<",
|
|
"TRC;",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TRC;>;TS;>;>;",
|
|
"Ljava/lang/Integer;",
|
|
"Ljava/lang/Integer;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, -0x1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
sget-object v2, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p2
|
|
|
|
invoke-virtual {v2, p2}, Lcom/discord/utilities/textprocessing/Rules;->createBoldColoredRule(I)Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/simpleast/core/parser/Rule;->getMatcher()Ljava/util/regex/Matcher;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v4}, Ljava/util/regex/Matcher;->pattern()Ljava/util/regex/Pattern;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {p2}, Lcom/discord/simpleast/core/parser/Rule;->getMatcher()Ljava/util/regex/Matcher;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v5}, Ljava/util/regex/Matcher;->pattern()Ljava/util/regex/Pattern;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-static {v4, v5}, Lw/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v3, -0x1
|
|
|
|
:goto_1
|
|
invoke-interface {p1, v3, p2}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_2
|
|
if-eqz p3, :cond_5
|
|
|
|
sget-object p2, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p3}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p3
|
|
|
|
invoke-virtual {p2, p3}, Lcom/discord/utilities/textprocessing/Rules;->createStrikethroughColoredRule(I)Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p3
|
|
|
|
:goto_2
|
|
invoke-interface {p3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
invoke-interface {p3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/simpleast/core/parser/Rule;->getMatcher()Ljava/util/regex/Matcher;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Ljava/util/regex/Matcher;->pattern()Ljava/util/regex/Pattern;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {p2}, Lcom/discord/simpleast/core/parser/Rule;->getMatcher()Ljava/util/regex/Matcher;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Ljava/util/regex/Matcher;->pattern()Ljava/util/regex/Pattern;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v2, v3}, Lw/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
move v0, v1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
:goto_3
|
|
invoke-interface {p1, v0, p2}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_5
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic updateSimpleRulesCustomColors$default(Lcom/discord/utilities/textprocessing/Parsers;Ljava/util/List;Ljava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)V
|
|
.locals 1
|
|
|
|
and-int/lit8 p5, p4, 0x2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
move-object p2, v0
|
|
|
|
:cond_0
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
if-eqz p4, :cond_1
|
|
|
|
move-object p3, v0
|
|
|
|
:cond_1
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/discord/utilities/textprocessing/Parsers;->updateSimpleRulesCustomColors(Ljava/util/List;Ljava/lang/Integer;Ljava/lang/Integer;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final escapeMarkdownCharacters(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 2
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
new-instance v0, Lkotlin/text/Regex;
|
|
|
|
const-string v1, "[*_~]"
|
|
|
|
invoke-direct {v0, v1}, Lkotlin/text/Regex;-><init>(Ljava/lang/String;)V
|
|
|
|
sget-object v1, Lcom/discord/utilities/textprocessing/Parsers$escapeMarkdownCharacters$1;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers$escapeMarkdownCharacters$1;
|
|
|
|
invoke-virtual {v0, p1, v1}, Lkotlin/text/Regex;->replace(Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final parseMarkdown(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;Ljava/lang/Integer;)Ljava/lang/CharSequence;
|
|
.locals 10
|
|
.param p3 # Ljava/lang/Integer;
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
.end annotation
|
|
.end param
|
|
.param p4 # Ljava/lang/Integer;
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
.end annotation
|
|
.end param
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {v2, v1}, Le/a/g/a/b/a;->a(ZI)Ljava/util/List;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {p0, v3, p3, p4}, Lcom/discord/utilities/textprocessing/Parsers;->updateSimpleRulesCustomColors(Ljava/util/List;Ljava/lang/Integer;Ljava/lang/Integer;)V
|
|
|
|
new-instance p3, Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
invoke-direct {p3, v2, v1, v0}, Lcom/discord/simpleast/core/parser/Parser;-><init>(ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sget-object p4, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p4}, Lcom/discord/utilities/textprocessing/Rules;->createSoftHyphenRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {p3, p4}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p3
|
|
|
|
sget-object p4, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p4}, Lcom/discord/utilities/textprocessing/Rules;->createBlockQuoteRule()Lcom/discord/simpleast/core/parser/Rule$BlockRule;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {p3, p4}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p3
|
|
|
|
sget-object p4, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p4}, Lcom/discord/utilities/textprocessing/Rules;->createMaskedLinkRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {p3, p4}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p3
|
|
|
|
sget-object p4, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p4}, Lcom/discord/utilities/textprocessing/Rules;->createUrlNoEmbedRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {p3, p4}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p3
|
|
|
|
sget-object p4, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p4}, Lcom/discord/utilities/textprocessing/Rules;->createUrlRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {p3, p4}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p3
|
|
|
|
sget-object p4, Lcom/discord/utilities/textprocessing/Rules;->INSTANCE:Lcom/discord/utilities/textprocessing/Rules;
|
|
|
|
invoke-virtual {p4}, Lcom/discord/utilities/textprocessing/Rules;->createHookedLinkRule()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {p3, p4}, Lcom/discord/simpleast/core/parser/Parser;->addRule(Lcom/discord/simpleast/core/parser/Rule;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/textprocessing/Parsers;->createMarkdownRules(Landroid/content/Context;)Ljava/util/List;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {p3, p4}, Lcom/discord/simpleast/core/parser/Parser;->addRules(Ljava/util/Collection;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {p3, v3}, Lcom/discord/simpleast/core/parser/Parser;->addRules(Ljava/util/Collection;)Lcom/discord/simpleast/core/parser/Parser;
|
|
|
|
move-result-object v4
|
|
|
|
sget-object p3, Lcom/discord/utilities/textprocessing/MessageParseState;->Companion:Lcom/discord/utilities/textprocessing/MessageParseState$Companion;
|
|
|
|
invoke-virtual {p3}, Lcom/discord/utilities/textprocessing/MessageParseState$Companion;->getInitialState()Lcom/discord/utilities/textprocessing/MessageParseState;
|
|
|
|
move-result-object v6
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x4
|
|
|
|
const/4 v9, 0x0
|
|
|
|
move-object v5, p2
|
|
|
|
invoke-static/range {v4 .. v9}, Lcom/discord/simpleast/core/parser/Parser;->parse$default(Lcom/discord/simpleast/core/parser/Parser;Ljava/lang/CharSequence;Ljava/lang/Object;Ljava/util/List;ILjava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p2
|
|
|
|
new-instance p3, Lcom/discord/utilities/textprocessing/Parsers$parseMarkdown$renderContext$1;
|
|
|
|
invoke-direct {p3, p1}, Lcom/discord/utilities/textprocessing/Parsers$parseMarkdown$renderContext$1;-><init>(Landroid/content/Context;)V
|
|
|
|
invoke-static {p2, p3}, Lcom/discord/utilities/textprocessing/AstRenderer;->render(Ljava/util/Collection;Ljava/lang/Object;)Lcom/facebook/drawee/span/DraweeSpanStringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "AstRenderer.render(ast, renderContext)"
|
|
|
|
invoke-static {p1, p2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const-string p1, "input"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|