From 4d5a380db7fc6d6380f42f72d099a38ca2f81d2d Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Fri, 28 Jul 2023 09:17:31 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=82=B7=E3=83=B3=E3=82=B0=E3=83=AB?= =?UTF-8?q?=E3=83=BB=E3=83=80=E3=83=96=E3=83=AB=E3=82=AF=E3=82=A9=E3=83=BC?= =?UTF-8?q?=E3=83=88=E4=B8=A1=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/jskult-webapp/src/model/view/bio_view_model.py | 5 +++-- ecs/jskult-webapp/src/templates/bioSearchList.html | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ecs/jskult-webapp/src/model/view/bio_view_model.py b/ecs/jskult-webapp/src/model/view/bio_view_model.py index ee36080b..57d5f153 100644 --- a/ecs/jskult-webapp/src/model/view/bio_view_model.py +++ b/ecs/jskult-webapp/src/model/view/bio_view_model.py @@ -62,8 +62,9 @@ class BioViewModel(BaseModel): part_size = 500 for i in range(0, search_data_len, part_size): json_str = json.dumps(search_data_list[i:i + part_size], ensure_ascii=False, default=date_handler) - # テンプレートに埋め込むため、ダブルクォートをエスケープして返す - json_str = json_str.replace('"', '\\"') + # JavaScriptに埋め込むため、クォートをエスケープ + json_str = json_str.replace("'", "\\'") + json_str = json_str.replace('\\"', '\\\\"') yield json_str def make_whs_name(self): diff --git a/ecs/jskult-webapp/src/templates/bioSearchList.html b/ecs/jskult-webapp/src/templates/bioSearchList.html index bac1b4ab..01f171a5 100644 --- a/ecs/jskult-webapp/src/templates/bioSearchList.html +++ b/ecs/jskult-webapp/src/templates/bioSearchList.html @@ -338,9 +338,9 @@ const searchResultData = [] // {% if bio.is_form_submitted() and not (bio.is_data_overflow_max_length() or bio.is_data_empty()) %} // {% autoescape False%} - // ジェネレータで100件ずつ取ってリストに詰める + // ジェネレータですこしずつ取得してリストに詰める // {% for bio_data_json_str in bio.bio_data_json_str() %} - searchResultData.push(...JSON.parse("{{bio_data_json_str}}")) + searchResultData.push(...JSON.parse('{{bio_data_json_str}}')) // {% endfor %} // {% endautoescape%} // {% endif %}