Add italicizing for [braced] text in quote text

This commit is contained in:
Xevion
2022-05-20 15:05:57 -05:00
parent 6e27d13a11
commit 5cf146cf97

View File

@@ -16,9 +16,7 @@
{{ quote.speaker }}
</span>
</td>
<td class="quote-text w-100 pr-3">
{{ quote.text }}
</td>
<td class="quote-text w-100 pr-3" v-html="transform(quote.text)" />
<td class="px-1 pl-2">
<a :href="quote_link(index)" class="no-link" @click="copy(index)">
<b-icon icon="link45deg" />
@@ -41,6 +39,12 @@ export default {
},
},
methods: {
transform(quoteText) {
if (quoteText.includes("[")) {
return quoteText.replace(/\[([^\]]+)]/, '<i>[$1]</i>')
}
return quoteText
},
quote_link(quoteIndex) {
return `/${this.$route.params.season}/${this.$route.params.episode}#${this.sceneIndex}-${quoteIndex}`;
},