Commit 576030aa authored by 李维's avatar 李维

修复苹果设备单引号不被识别的问题

parent a85af4ea
...@@ -1885,6 +1885,13 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -1885,6 +1885,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 开放型回答 只要有内容就算对 // 开放型回答 只要有内容就算对
right = userInputText != ""; right = userInputText != "";
} else { } else {
// 替换特殊的符号
const standardApostrophe = "'";
const isoApostrophe = "";
const regApostrophe = new RegExp(isoApostrophe, "g")
userInputText = userInputText.replace(regApostrophe, standardApostrophe);
configInputText = configInputText.replace(regApostrophe, standardApostrophe);
// 除特殊配置, 默认进行缩写通配符替换 // 除特殊配置, 默认进行缩写通配符替换
if(!contentData.notAdaptContraction) { if(!contentData.notAdaptContraction) {
userInputText = this.adaptContraction(userInputText); userInputText = this.adaptContraction(userInputText);
...@@ -1986,6 +1993,13 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -1986,6 +1993,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 开放型回答 只要有内容就算对 // 开放型回答 只要有内容就算对
right = userInputText != ""; right = userInputText != "";
} else { } else {
// 替换特殊的符号
const standardApostrophe = "'";
const isoApostrophe = "";
const regApostrophe = new RegExp(isoApostrophe, "g")
userInputText = userInputText.replace(regApostrophe, standardApostrophe);
configInputText = configInputText.replace(regApostrophe, standardApostrophe);
// 除特殊配置, 默认进行缩写通配符替换 // 除特殊配置, 默认进行缩写通配符替换
if(!option.notAdaptContraction) { if(!option.notAdaptContraction) {
userInputText = this.adaptContraction(userInputText); userInputText = this.adaptContraction(userInputText);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment