mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
all fields in text sources are lazy
This commit is contained in:
parent
bb3ebb455e
commit
4ac01d5331
@ -8,7 +8,7 @@ class BoldTextSource(
|
||||
source: String,
|
||||
textParts: List<TextPart>
|
||||
) : MultilevelTextSource {
|
||||
override val textParts: List<TextPart> = source.fullListOfSubSource(textParts)
|
||||
override val textParts: List<TextPart> by lazy { source.fullListOfSubSource(textParts) }
|
||||
override val asMarkdownSource: String by lazy { source.boldMarkdown() }
|
||||
override val asMarkdownV2Source: String by lazy { boldMarkdownV2() }
|
||||
override val asHtmlSource: String by lazy { boldHTML() }
|
||||
|
@ -15,9 +15,11 @@ class HashTagTextSource(
|
||||
source: String,
|
||||
textParts: List<TextPart>
|
||||
) : MultilevelTextSource {
|
||||
override val textParts: List<TextPart> = source.withoutSharp.fullListOfSubSource(
|
||||
textParts.shiftSourcesToTheLeft(1)
|
||||
)
|
||||
override val textParts: List<TextPart> by lazy {
|
||||
source.withoutSharp.fullListOfSubSource(
|
||||
textParts.shiftSourcesToTheLeft(1)
|
||||
)
|
||||
}
|
||||
override val asMarkdownSource: String by lazy { source.hashTagMarkdown() }
|
||||
override val asMarkdownV2Source: String by lazy { hashTagMarkdownV2() }
|
||||
override val asHtmlSource: String by lazy { hashTagHTML() }
|
||||
|
@ -8,7 +8,7 @@ class ItalicTextSource(
|
||||
source: String,
|
||||
textParts: List<TextPart>
|
||||
) : MultilevelTextSource {
|
||||
override val textParts: List<TextPart> = source.fullListOfSubSource(textParts)
|
||||
override val textParts: List<TextPart> by lazy { source.fullListOfSubSource(textParts) }
|
||||
override val asMarkdownSource: String by lazy { source.italicMarkdown() }
|
||||
override val asMarkdownV2Source: String by lazy { italicMarkdownV2() }
|
||||
override val asHtmlSource: String by lazy { italicHTML() }
|
||||
|
@ -8,7 +8,7 @@ class PhoneNumberTextSource(
|
||||
source: String,
|
||||
textParts: List<TextPart>
|
||||
) : MultilevelTextSource {
|
||||
override val textParts: List<TextPart> = source.fullListOfSubSource(textParts)
|
||||
override val textParts: List<TextPart> by lazy { source.fullListOfSubSource(textParts) }
|
||||
override val asMarkdownSource: String by lazy { source.phoneMarkdown() }
|
||||
override val asMarkdownV2Source: String by lazy { phoneMarkdownV2() }
|
||||
override val asHtmlSource: String by lazy { phoneHTML() }
|
||||
|
@ -8,7 +8,7 @@ class StrikethroughTextSource(
|
||||
source: String,
|
||||
textParts: List<TextPart>
|
||||
) : MultilevelTextSource {
|
||||
override val textParts: List<TextPart> = source.fullListOfSubSource(textParts)
|
||||
override val textParts: List<TextPart> by lazy { source.fullListOfSubSource(textParts) }
|
||||
override val asHtmlSource: String by lazy { strikethroughHTML() }
|
||||
override val asMarkdownV2Source: String by lazy { strikethroughMarkdownV2() }
|
||||
override val asMarkdownSource: String by lazy { source.strikethroughMarkdown() }
|
||||
|
@ -8,7 +8,7 @@ class UnderlineTextSource(
|
||||
source: String,
|
||||
textParts: List<TextPart>
|
||||
) : MultilevelTextSource {
|
||||
override val textParts: List<TextPart> = source.fullListOfSubSource(textParts)
|
||||
override val textParts: List<TextPart> by lazy { source.fullListOfSubSource(textParts) }
|
||||
override val asMarkdownSource: String by lazy { source.underlineMarkdown() }
|
||||
override val asMarkdownV2Source: String by lazy { underlineMarkdownV2() }
|
||||
override val asHtmlSource: String by lazy { underlineHTML() }
|
||||
|
Loading…
Reference in New Issue
Block a user