18 Commits

Author SHA1 Message Date
52259d573c Merge branch 'dev' of https://gitea.f2b211.com/jsasg/orico-official-website into dev 2025-07-17 15:20:55 +08:00
a680391d86 1 2025-07-17 15:19:56 +08:00
0e0ed64b38 1 2025-07-17 15:18:38 +08:00
5221b43c01 1 2025-07-17 15:13:01 +08:00
a373ee7163 1 2025-07-17 15:08:52 +08:00
07692a2a29 1 2025-07-17 12:00:46 +08:00
3c7bdd8ac9 Merge branch 'master' of https://gitea.f2b211.com/jsasg/orico-official-website 2025-07-17 11:49:33 +08:00
db3b704d89 1 2025-07-17 11:49:31 +08:00
6e3e0d59db fix: database/seeds 2025-07-17 11:44:00 +08:00
f8884aa736 1 2025-07-17 11:42:38 +08:00
8e62d95864 1 2025-07-17 11:30:52 +08:00
7bf88fd578 英文单词不换行 2025-07-17 10:48:37 +08:00
a4330c1216 1 2025-07-17 10:36:36 +08:00
6c80dbabeb 图片拉伸 2025-07-17 10:24:00 +08:00
e0009fb8fa .header-PC #header .nav3 .choesCountry 2025-07-17 10:19:09 +08:00
702e874e08 1 2025-07-17 09:49:05 +08:00
7e486e463c Merge branch 'master' of https://gitea.f2b211.com/jsasg/orico-official-website 2025-07-17 09:45:12 +08:00
df482bbcdd .ql-editor>* 2025-07-17 09:45:07 +08:00
6 changed files with 91 additions and 18 deletions

View File

@@ -172,6 +172,45 @@
}) })
}, 300); }, 300);
}); });
// 英文截断
// 处理 #rendered-content 内的内容
$('#rendered-content').html(function(i, html) {
// 1. 先保护真正的空行(只包含 的标签)
html = html.replace(/<(p|h[1-6])>(<strong>)?(&nbsp;| )*(<\/strong>)?<\/\1>/g, function(match) {
// 统一空行格式为 <p>&nbsp;</p> 或 <h2>&nbsp;</h2> 形式
return match.replace(/(<p>|<h[1-6]>)\s*(<strong>)?\s*(&nbsp;| )*\s*(<\/strong>)?\s*(<\/p>|<\/h[1-6]>)/,
function(m) {
var tag = m.match(/<(p|h[1-6])>/)[1];
return '<' + tag + '>&nbsp;</' + tag + '>';
});
});
// 2. 替换其他&nbsp;为普通空格(保留单词间的空格)
html = html.replace(/&nbsp;(?=\w)/g, ' ');
return html;
});
// 添加CSS样式确保英文单词完整换行
$('#rendered-content').css({
'word-wrap': 'break-word',
'overflow-wrap': 'break-word',
'word-break': 'normal',
'white-space': 'normal'
});
// 优化英文单词间的空格处理
$('#rendered-content').find('p, h1, h2, h3, h4, h5, h6').each(function() {
var $el = $(this);
// 只处理非空行
if ($el.html().trim() !== '&nbsp;') {
var html = $el.html()
.replace(/([a-zA-Z])(&nbsp;| )+([a-zA-Z])/g, '$1 $3') // 单词间保留一个空格
.replace(/(\d)(&nbsp;| )+([a-zA-Z])/g, '$1 $3') // 数字和单词间
.replace(/([a-zA-Z])(&nbsp;| )+(\d)/g, '$1 $3'); // 单词和数字间
$el.html(html);
}
});
}); });
</script> </script>
{/block} {/block}

View File

@@ -144,7 +144,21 @@ body {
margin: 0; margin: 0;
padding: 0 padding: 0
} }
/* 空白占位符样式 */
.space-char {
display: inline;
white-space: pre; /* 保留空白 */
position: relative;
padding-right: 0.15em; /* 视觉间距补偿 */
}
.space-char:after {
content: " ";
visibility: hidden;
}
.space-replaced {
display: inline;
white-space: normal;
}
.ql-editor { .ql-editor {
box-sizing: border-box; box-sizing: border-box;
line-height: 1.42; line-height: 1.42;
@@ -155,23 +169,37 @@ body {
tab-size: 4; tab-size: 4;
-moz-tab-size: 4; -moz-tab-size: 4;
text-align: left; text-align: left;
white-space: pre-wrap; word-wrap: break-word;
word-wrap: break-word; /* 兼容旧浏览器 */ overflow-wrap: break-word;
overflow-wrap: break-word; /* 优先在空格处换行,避免单词拆分 */ word-break: normal;
word-break: normal; /* 禁止强制拆分单词 */ white-space: normal;
hyphens: auto; /* 可选:超长单词用连字符换行(更优雅) */
} }
.ql-editor>* { .ql-editor>* {
cursor: text cursor: text;
word-break: normal;
overflow-wrap: normal;
} }
.ql-editor p,.ql-editor ol,.ql-editor ul,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6 { .ql-editor p,.ql-editor ol,.ql-editor ul,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6 {
margin: 0; margin: 0;
padding: 0; padding: 0;
counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9 counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
word-wrap: break-word;
overflow-wrap: break-word;
word-break: keep-all;
white-space: normal;
}
/* 移动端优化 */
@media (max-width: 768px) {
.narshelpCenterdetail-app .nhlp-app-content {
width: 95%;
}
.ql-editor p,
.ql-editor li {
display: block; /* 移动端改用块级布局 */
}
} }
.ql-editor ol,.ql-editor ul { .ql-editor ol,.ql-editor ul {
padding-left: 1.5em padding-left: 1.5em
} }

View File

@@ -40,9 +40,12 @@
} }
.narshelpCenterdetail-app .nhlp-app-content { .narshelpCenterdetail-app .nhlp-app-content {
margin: 1.25rem; /* margin: 1rem; */
height: 100%; height: 100%;
margin-top: 9.2vh; margin-top: 9.2vh;
width: 90%;
margin: 0 auto;
margin-top: 5rem;
} }
.narshelpCenterdetail-app #rendered-content img { .narshelpCenterdetail-app #rendered-content img {

View File

@@ -212,6 +212,7 @@
.header-PC #header .nav3 .choesCountry { .header-PC #header .nav3 .choesCountry {
position: relative; position: relative;
margin-left: 15%; margin-left: 15%;
display: flex;
} }
.header-PC #header .nav3 .choesCountry .topCountry { .header-PC #header .nav3 .choesCountry .topCountry {
display: none; display: none;

View File

@@ -410,7 +410,7 @@
flex-direction: column; flex-direction: column;
} }
.orico_Page_prdetail .oriprdetail .oriprInfo img { .orico_Page_prdetail .oriprdetail .oriprInfo img {
max-width: 100%; width: 100%;
} }
.orico_Page_prdetail .oriprdetail .oriprInfo .titleprinfo { .orico_Page_prdetail .oriprdetail .oriprInfo .titleprinfo {
text-align: center; text-align: center;

View File

@@ -254,21 +254,23 @@ div{
tab-size: 4; tab-size: 4;
-moz-tab-size: 4; -moz-tab-size: 4;
text-align: left; text-align: left;
white-space: pre-wrap; word-wrap: normal;
word-wrap: break-word; /* 兼容旧浏览器 */ overflow-wrap: normal;
overflow-wrap: break-word; /* 优先在空格处换行,避免单词拆分 */ word-break: normal;
word-break: normal; /* 禁止强制拆分单词 */ hyphens: manual;
hyphens: auto; /* 可选:超长单词用连字符换行(更优雅) */ white-space: normal;
} }
.ql-editor>* { .ql-editor>* {
cursor: text cursor: text;
} }
.ql-editor p,.ql-editor ol,.ql-editor ul,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6 { .ql-editor p,.ql-editor ol,.ql-editor ul,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6 {
margin: 0; margin: 0;
padding: 0; padding: 0;
counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9 counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
overflow-wrap: anywhere;
word-break: keep-all;
} }
.ql-editor ol,.ql-editor ul { .ql-editor ol,.ql-editor ul {