feat: add text formatting (bold/italic/strikethrough)

This commit is contained in:
ThetaDev 2024-04-03 03:28:13 +02:00
parent 449fc0128e
commit b8825f9199
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
10 changed files with 858 additions and 145 deletions

View file

@ -0,0 +1,50 @@
---
source: src/serializer/text.rs
expression: split
---
[
TextComponents(
[
Text {
text: "Hello",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Text {
text: " World",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
],
),
TextComponents(
[
Text {
text: "T2",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
],
),
TextComponents(
[
Text {
text: "T3",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
],
),
]

View file

@ -0,0 +1,74 @@
---
source: src/serializer/text.rs
expression: res
---
SAttributed {
ln: TextComponents(
[
Text {
text: "Bold: ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Text {
text: "Awesome",
style: Style {
bold: true,
italic: false,
strikethrough: false,
},
},
Text {
text: "\nItalic: ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Text {
text: "Great",
style: Style {
bold: false,
italic: true,
strikethrough: false,
},
},
Text {
text: "\nCut: ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Text {
text: "Dumb",
style: Style {
bold: false,
italic: false,
strikethrough: true,
},
},
Text {
text: "\n\nMixed: ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Text {
text: "Mixer",
style: Style {
bold: true,
italic: true,
strikethrough: true,
},
},
],
),
}

View file

@ -7,6 +7,11 @@ SAttributed {
[
Text {
text: "🎧Listen and download aespa's debut single \"Black Mamba\": ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Web {
text: "https://smarturl.it/aespa_BlackMamba",
@ -14,6 +19,11 @@ SAttributed {
},
Text {
text: "\n🐍The Debut Stage ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Video {
text: "aespa 에스파 'Black ...",
@ -23,6 +33,11 @@ SAttributed {
},
Text {
text: "\n\n🎟\u{fe0f} aespa Showcase SYNK in LA! Tickets now on sale: ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Web {
text: "https://www.ticketmaster.com/event/0A...",
@ -30,6 +45,11 @@ SAttributed {
},
Text {
text: "\n\nSubscribe to aespa Official YouTube Channel!\n",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Web {
text: "https://www.youtube.com/aespa?sub_con...",
@ -37,6 +57,11 @@ SAttributed {
},
Text {
text: "\n\naespa official\n",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Web {
text: "aespa",
@ -44,6 +69,11 @@ SAttributed {
},
Text {
text: "\n",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Web {
text: "https://www.instagram.com/aespa_official",
@ -51,6 +81,11 @@ SAttributed {
},
Text {
text: "\n",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Web {
text: "https://www.tiktok.com/@aespa_official",
@ -58,6 +93,11 @@ SAttributed {
},
Text {
text: "\n",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Web {
text: "https://twitter.com/aespa_Official",
@ -65,6 +105,11 @@ SAttributed {
},
Text {
text: "\n",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Web {
text: "https://www.facebook.com/aespa.official",
@ -72,6 +117,11 @@ SAttributed {
},
Text {
text: "\n",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Web {
text: "https://weibo.com/aespa",
@ -79,6 +129,11 @@ SAttributed {
},
Text {
text: "\n\n",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Browse {
text: "#aespa",
@ -87,6 +142,11 @@ SAttributed {
},
Text {
text: " ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Browse {
text: "#æspa",
@ -95,6 +155,11 @@ SAttributed {
},
Text {
text: " ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Browse {
text: "#BlackMamba",
@ -103,6 +168,11 @@ SAttributed {
},
Text {
text: " ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Browse {
text: "#블랙맘바",
@ -111,6 +181,11 @@ SAttributed {
},
Text {
text: " ",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
Browse {
text: "#에스파",
@ -119,6 +194,11 @@ SAttributed {
},
Text {
text: "\naespa 에스파 'Black Mamba' MV ℗ SM Entertainment",
style: Style {
bold: false,
italic: false,
strikethrough: false,
},
},
],
),