diff --git a/src/views/TopicShow.vue b/src/views/TopicShow.vue index 4665b9c..5bf7c7c 100644 --- a/src/views/TopicShow.vue +++ b/src/views/TopicShow.vue @@ -2,7 +2,7 @@ import { computed } from 'vue' import { useRoute, useRouter } from 'vue-router'; import { state } from '@/stores'; -import type { Topic } from '@/types'; +import type { Paper, Topic } from '@/types'; const router = useRouter() const route = useRoute() @@ -14,7 +14,13 @@ const topic = computed(() => { return state.topics?.find( (topic: Topic) => topic.reference == routeId.value ) }) const firstPaper = computed(() => { - return topic.value?.papers[0] + return topic.value?.papers[0] as Paper +}) +const subject = computed(() => { + const subjectStart = firstPaper?.value.content.search(/(?<=Sachverhalt)/g) || 0 + const subjectEnd = firstPaper?.value.content.search(/Anlage/g) + + return firstPaper.value?.content.substring(subjectStart, subjectEnd).trim() }) function goBack() { @@ -23,22 +29,25 @@ function goBack() {