From dbffe0d66bc73ffd3fa47c175ac8d5d15f844cb9 Mon Sep 17 00:00:00 2001 From: natyusha <985941+natyusha@users.noreply.github.com> Date: Tue, 17 Sep 2024 16:07:44 -0400 Subject: [PATCH 1/2] Description Filter Tweaks - clean lines starting with "From" / "See Also" - account for some "Source" Lines being enclosed in brackets - exclude an edge case describing what the word daikon means --- src/components/Collection/CleanDescription.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Collection/CleanDescription.tsx b/src/components/Collection/CleanDescription.tsx index 407f54c4..377f848b 100644 --- a/src/components/Collection/CleanDescription.tsx +++ b/src/components/Collection/CleanDescription.tsx @@ -4,7 +4,7 @@ import cx from 'classnames'; import { useSettingsQuery } from '@/core/react-query/settings/queries'; // The question marks are there because people can't spell… -const CleanInfoLinesRegex = /\b((Modified )?Sour?ce|Note( [1-9])?|Summ?ary):(?!$)([^\r\n]+|$)/img; +const CleanInfoLinesRegex = /\(?\b((Modified )?Sour?ce|Note( [1-9])?|Summ?ary|From|See Also):(?!$| a daikon)([^\r\n]+|$)/img; // eslint-disable-next-line operator-linebreak -- Because dprint and eslint can't agree otherwise. Feel free to fix it. const CleanMiscLinesRegex = From 9fd4021bf3fb17dd0f06153b94e13baa065696ec Mon Sep 17 00:00:00 2001 From: natyusha <985941+natyusha@users.noreply.github.com> Date: Tue, 17 Sep 2024 16:21:17 -0400 Subject: [PATCH 2/2] Formatting --- src/components/Collection/CleanDescription.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Collection/CleanDescription.tsx b/src/components/Collection/CleanDescription.tsx index 377f848b..81bac28f 100644 --- a/src/components/Collection/CleanDescription.tsx +++ b/src/components/Collection/CleanDescription.tsx @@ -4,7 +4,9 @@ import cx from 'classnames'; import { useSettingsQuery } from '@/core/react-query/settings/queries'; // The question marks are there because people can't spell… -const CleanInfoLinesRegex = /\(?\b((Modified )?Sour?ce|Note( [1-9])?|Summ?ary|From|See Also):(?!$| a daikon)([^\r\n]+|$)/img; +// eslint-disable-next-line operator-linebreak -- Because dprint and eslint can't agree otherwise. Feel free to fix it. +const CleanInfoLinesRegex = + /\(?\b((Modified )?Sour?ce|Note( [1-9])?|Summ?ary|From|See Also):(?!$| a daikon)([^\r\n]+|$)/img; // eslint-disable-next-line operator-linebreak -- Because dprint and eslint can't agree otherwise. Feel free to fix it. const CleanMiscLinesRegex =