From f40804411e44805b4e5e16b595dfa57708c1a96b Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 25 Mar 2020 11:10:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=80=9A=E7=9F=A5=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/notice/beans/NoticeInfo.java | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dad4a61cb..6699cf29c 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.4.11 + 1.4.12 UTF-8 1.8.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeInfo.java b/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeInfo.java index b018e3d41..2bb82f64c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeInfo.java +++ b/src/main/java/au/com/royalpay/payment/manage/notice/beans/NoticeInfo.java @@ -12,6 +12,8 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Created by yishuqian on 28/09/2016. @@ -54,6 +56,9 @@ public class NoticeInfo { } res.put("merchants_type",merchants_type); if (content != null){ + if (content.contains("]*?)\\s+width\\s*=\\s*\\S+", "$1 width=100%")); + }else { + String regex = "(?i)(\\]+\\>)"; + setContent(content.replaceAll(regex, "$1 width =\"100%\"$2")); + } + Matcher matcherForHeight = Pattern.compile(regxpForHeight).matcher(imgStr); + if (matcherForHeight.find()){ + setContent(content.replaceAll("(]*?)\\s+height\\s*=\\s*\\S+", "$1 height=100%")); + }else { + String regex = "(?i)(\\]+\\>)"; + setContent(content.replaceAll(regex, "$1 height =\"100%\"$2")); + } + } + } public String getTitle() { return title; }