mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-15 22:13:18 -06:00
Add italicizing for [braced] text in quote text
This commit is contained in:
@@ -16,9 +16,7 @@
|
|||||||
{{ quote.speaker }}
|
{{ quote.speaker }}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="quote-text w-100 pr-3">
|
<td class="quote-text w-100 pr-3" v-html="transform(quote.text)" />
|
||||||
{{ quote.text }}
|
|
||||||
</td>
|
|
||||||
<td class="px-1 pl-2">
|
<td class="px-1 pl-2">
|
||||||
<a :href="quote_link(index)" class="no-link" @click="copy(index)">
|
<a :href="quote_link(index)" class="no-link" @click="copy(index)">
|
||||||
<b-icon icon="link45deg" />
|
<b-icon icon="link45deg" />
|
||||||
@@ -41,6 +39,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
transform(quoteText) {
|
||||||
|
if (quoteText.includes("[")) {
|
||||||
|
return quoteText.replace(/\[([^\]]+)]/, '<i>[$1]</i>')
|
||||||
|
}
|
||||||
|
return quoteText
|
||||||
|
},
|
||||||
quote_link(quoteIndex) {
|
quote_link(quoteIndex) {
|
||||||
return `/${this.$route.params.season}/${this.$route.params.episode}#${this.sceneIndex}-${quoteIndex}`;
|
return `/${this.$route.params.season}/${this.$route.params.episode}#${this.sceneIndex}-${quoteIndex}`;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user