mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-19 13:00:46 +01:00
Add advanced parser annotation
This commit is contained in:
parent
a3a8a5b0b5
commit
bc6ca2449e
@ -108,6 +108,13 @@ import javax.inject.Qualifier
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class SimpleCommonmarkParser
|
||||
|
||||
/**
|
||||
* Used to inject the advanced commonmark Parser
|
||||
*/
|
||||
@Qualifier
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class AdvancedCommonmarkParser
|
||||
|
||||
@Module
|
||||
internal abstract class RoomModule {
|
||||
|
||||
@ -128,8 +135,9 @@ internal abstract class RoomModule {
|
||||
}
|
||||
|
||||
@Provides
|
||||
@AdvancedCommonmarkParser
|
||||
@JvmStatic
|
||||
fun providesParser(): Parser {
|
||||
fun providesAdvancedParser(): Parser {
|
||||
return Parser.builder().build()
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ package org.matrix.android.sdk.internal.session.room.send
|
||||
|
||||
import org.commonmark.parser.Parser
|
||||
import org.commonmark.renderer.html.HtmlRenderer
|
||||
import org.matrix.android.sdk.internal.session.room.AdvancedCommonmarkParser
|
||||
import org.matrix.android.sdk.internal.session.room.SimpleCommonmarkParser
|
||||
import org.matrix.android.sdk.internal.session.room.send.pills.TextPillsUtils
|
||||
import javax.inject.Inject
|
||||
@ -28,7 +29,7 @@ import javax.inject.Inject
|
||||
* If any change is required, please add a test covering the problem and make sure all the tests are still passing.
|
||||
*/
|
||||
internal class MarkdownParser @Inject constructor(
|
||||
private val advancedParser: Parser,
|
||||
@AdvancedCommonmarkParser private val advancedParser: Parser,
|
||||
@SimpleCommonmarkParser private val simpleParser: Parser,
|
||||
private val htmlRenderer: HtmlRenderer,
|
||||
private val textPillsUtils: TextPillsUtils
|
||||
|
Loading…
Reference in New Issue
Block a user