From c8dc59a1edce250b5491a38b77717c4bd327bf09 Mon Sep 17 00:00:00 2001 From: thekingofcity <3353040+thekingofcity@users.noreply.github.com> Date: Sun, 29 Dec 2024 12:08:27 +0800 Subject: [PATCH] #763 Upgrade save replacing all names from `\\` to `\n` (#899) --- src/components/page-header/rmp-to-rmg.tsx | 2 +- .../details/info-multiple-selection.tsx | 2 +- .../svgs/nodes/jr-east-line-badge.tsx | 14 ++-- .../svgs/stations/bjsubway-basic.tsx | 28 +++---- src/components/svgs/stations/bjsubway-int.tsx | 26 +++--- .../svgs/stations/foshan-metro-basic.tsx | 12 +-- .../stations/guangdong-intercity-railway.tsx | 6 +- src/components/svgs/stations/gzmtr-basic.tsx | 12 +-- src/components/svgs/stations/gzmtr-int.tsx | 12 +-- .../svgs/stations/jr-east-basic.tsx | 34 ++++---- .../svgs/stations/jr-east-important.tsx | 6 +- .../svgs/stations/kunmingrt-basic.tsx | 14 ++-- .../svgs/stations/kunmingrt-int.tsx | 14 ++-- src/components/svgs/stations/mrt-basic.tsx | 6 +- src/components/svgs/stations/mrt-int.tsx | 6 +- src/components/svgs/stations/mtr.tsx | 14 ++-- .../stations/shanghai-suburban-railway.tsx | 14 ++-- .../svgs/stations/shmetro-basic-2020.tsx | 14 ++-- .../svgs/stations/shmetro-basic.tsx | 14 ++-- src/components/svgs/stations/shmetro-int.tsx | 14 ++-- .../svgs/stations/shmetro-osysi.tsx | 14 ++-- .../svgs/stations/suzhourt-basic.tsx | 20 ++--- src/components/svgs/stations/suzhourt-int.tsx | 14 ++-- .../svgs/stations/tokyo-metro-basic.tsx | 12 +-- .../svgs/stations/tokyo-metro-int.tsx | 10 +-- src/constants/stations.ts | 2 +- src/saves/shanghai.json | 2 +- src/saves/tutorial.json | 4 +- src/util/save.test.ts | 10 +++ src/util/save.ts | 84 ++++++++++++++++++- 30 files changed, 262 insertions(+), 174 deletions(-) diff --git a/src/components/page-header/rmp-to-rmg.tsx b/src/components/page-header/rmp-to-rmg.tsx index 2c1362a5b..e2b951c96 100644 --- a/src/components/page-header/rmp-to-rmg.tsx +++ b/src/components/page-header/rmp-to-rmg.tsx @@ -214,7 +214,7 @@ export const ToRmgEndSelectModal = (props: { whiteSpace="nowrap" display="ruby" > - {name1.replaceAll('\\', '⏎')}/{name2.replaceAll('\\', '⏎')} + {name1.replaceAll('\n', '⏎')}/{name2.replaceAll('\n', '⏎')} ))} diff --git a/src/components/panels/details/info-multiple-selection.tsx b/src/components/panels/details/info-multiple-selection.tsx index 6101d4f11..e4e3fd723 100644 --- a/src/components/panels/details/info-multiple-selection.tsx +++ b/src/components/panels/details/info-multiple-selection.tsx @@ -100,7 +100,7 @@ export default function InfoMultipleSection() { whiteSpace="nowrap" display="ruby" > - {getName(id)?.replaceAll('\\', '⏎')} + {getName(id)?.replaceAll('\n', '⏎')}