diff --git a/docs/js/quote-translate.js b/docs/js/quote-translate.js
index d19b224..74cfe63 100644
--- a/docs/js/quote-translate.js
+++ b/docs/js/quote-translate.js
@@ -1,26 +1,26 @@
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('blockquote[data-cn]').forEach(function (el) {
- const orig = el.getAttribute('data-orig');
- const cn = el.getAttribute('data-cn');
+ const cn = el.getAttribute('data-cn').split('|');
+ // 收集所有文本节点
+ const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT);
+ const nodes = [];
+ while (walker.nextNode()) nodes.push(walker.currentNode);
+ // 存原文
+ const orig = nodes.map(n => n.textContent);
let showing = 'orig';
function swap(to) {
- const text = to === 'cn' ? cn : orig;
- // 清空并重建文本内容,保留换行
- el.innerHTML = text.split('
').join('\n')
- .split('\n').map((line, i, arr) => {
- if (i === arr.length - 1 && line === '') return '';
- return line;
- }).join('
');
+ if (to === 'cn') {
+ cn.forEach((text, i) => { if (nodes[i]) nodes[i].textContent = text; });
+ } else {
+ orig.forEach((text, i) => { if (nodes[i]) nodes[i].textContent = text; });
+ }
showing = to;
}
el.style.cursor = 'pointer';
el.addEventListener('mouseenter', () => swap('cn'));
el.addEventListener('mouseleave', () => swap('orig'));
- el.addEventListener('click', (e) => {
- e.preventDefault();
- swap(showing === 'orig' ? 'cn' : 'orig');
- });
+ el.addEventListener('click', () => swap(showing === 'orig' ? 'cn' : 'orig'));
});
});
diff --git a/docs/shared/new-saas-revolution.md b/docs/shared/new-saas-revolution.md
index 9dbf5ac..e6a7f05 100644
--- a/docs/shared/new-saas-revolution.md
+++ b/docs/shared/new-saas-revolution.md
@@ -13,50 +13,44 @@ echo "of the human, by the human, for the human" | sed 's/human/AI/g'
---
-
-Umwertung aller Werte. - -— Nietzsche ++--- -Umwertung aller Werte.
+— Nietzsche
-Die Proletarier haben nichts in ihr zu verlieren als ihre Ketten. Sie haben eine Welt zu gewinnen. - -— Marx ++---Die Proletarier haben nichts in ihr zu verlieren als ihre Ketten. Sie haben eine Welt zu gewinnen.
+— Marx
-枪杆子里面出政权。 - -— 毛泽东 +--- -枪杆子里面出政权。
+— 毛泽东
-I have a dream, today. - -— Martin Luther King Jr. ++--- -I have a dream, today.
+— Martin Luther King Jr.
-of the people, by the people, for the people. - -— Lincoln ++--- -of the people, by the people, for the people.
+— Lincoln
-Hasta la victoria siempre. - -— Che Guevara ++---Hasta la victoria siempre.
+— Che Guevara