File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import {arrayBufferToBase64} from "@/utils/bytes2img.js"
55import {appTitle } from " @/composables/appTitle.js"
66import i18n from ' ../i18n'
77import StatusItem from " ./StatusItem.vue"
8- import {convertFraction , formatYear } from " @/utils/formatter.js" ;
8+ import {convertFraction , convertLinksToAnchors , formatYear } from " @/utils/formatter.js" ;
99import {useService } from " @/composables/useService.js" ;
1010import InfoRow from " @/components/InfoRow.vue" ;
1111
@@ -171,8 +171,8 @@ onUnmounted(async () => {
171171 </v-container >
172172
173173 <v-container >
174- <p >{{ coinData[service.infoFieldIndex('features')] }} </p >
175- <p >{{ coinData[service.infoFieldIndex('subject')] }} </p >
174+ <p v-html = " convertLinksToAnchors( coinData[service.infoFieldIndex('features')]) " > </p >
175+ <p v-html = " convertLinksToAnchors( coinData[service.infoFieldIndex('subject')]) " > </p >
176176 </v-container >
177177</template >
178178
Original file line number Diff line number Diff line change @@ -60,3 +60,13 @@ export function formatYear(enable_bc, year) {
6060
6161 return year ;
6262}
63+
64+ export function convertLinksToAnchors ( text ) {
65+ const urlRegex = / ( h t t p s ? : \/ \/ [ ^ \s ] + ) / g;
66+ try {
67+ return text . replace ( urlRegex , '<a href="$1" target="_blank">$1</a>' ) ;
68+ }
69+ catch ( e ) {
70+ return text ;
71+ }
72+ }
You can’t perform that action at this time.
0 commit comments