diff --git a/.gitignore b/.gitignore
index ec65c4fc6..daaf916ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,3 +30,6 @@ packages/**/yarn.lock
# config
examples/cherry-markdown-publish/src/common/config/*.yaml
+
+# CodeBuddy local data
+.codebuddy/
diff --git a/examples/ai_chat.html b/examples/ai_chat.html
index e42318c7b..427b8521f 100644
--- a/examples/ai_chat.html
+++ b/examples/ai_chat.html
@@ -5,7 +5,7 @@
流式输出md内容
-
+
-
+
+
+
+
+
+ Cherry Editor - Markdown Editor
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/examples/chart_toolbar_demo.html b/examples/chart_toolbar_demo.html
index 125652d21..c4527aec6 100644
--- a/examples/chart_toolbar_demo.html
+++ b/examples/chart_toolbar_demo.html
@@ -1,20 +1,23 @@
-
-
-
-
-
+
+
+
+
+
Cherry Markdown - 图表工具栏测试
-
-
-
-
-
-
+
+
+
+
+
-
+
+
-
+
diff --git a/examples/chatgpt.html b/examples/chatgpt.html
index 1d86571b2..793ec00f6 100644
--- a/examples/chatgpt.html
+++ b/examples/chatgpt.html
@@ -44,7 +44,7 @@
-
+
diff --git a/examples/custom_codeblock_wrapper.html b/examples/custom_codeblock_wrapper.html
index 28747cc96..1df04edff 100644
--- a/examples/custom_codeblock_wrapper.html
+++ b/examples/custom_codeblock_wrapper.html
@@ -1,215 +1,216 @@
-
-
-
-
-
- 自定义代码块外层容器 - Cherry Editor
-
-
-
-
-
-
-
-
-
-
-
+
+
+ }
+ },
+ toolbars: {
+ toolbar: [
+ 'bold',
+ 'italic',
+ 'size',
+ '|',
+ 'color',
+ 'header',
+ '|',
+ 'drawIo',
+ '|',
+ 'ol',
+ 'ul',
+ 'checklist',
+ 'panel',
+ 'align',
+ 'detail',
+ '|',
+ 'formula',
+ 'graph',
+ 'proTable',
+ 'codeTheme',
+ 'search',
+ 'shortcutKey',
+ ],
+ },
+ previewer: {
+ enablePreviewerBubble: false,
+ }
+ };
+ var sourceCode = document.documentElement.outerHTML;
+ var cherry = new Cherry(config);
+ cherry.setValue('\n## 自定义json代码块的特殊渲染\n\n```json\n{\n"--oc-white": "#ffffff",\n"--oc-black": "#000000",\n"--oc-gray-0": "#f8f9fa",\n"--oc-gray-1": "#f1f3f5",\n"--oc-gray-2": "#e9ecef",\n"--oc-gray-3": "#dee2e6",\n"--oc-gray-4": "#ced4da",\n"--oc-gray-5": "#adb5bd",\n"--oc-gray-6": "#868e96",\n"--oc-gray-7": "#495057",\n"--oc-gray-8": "#343a40",\n"--oc-gray-9": "#212529"\n}\n```\n\n');
+ // 绑定 body的点击事件,判断是否为 .j-switch 元素
+ document.body.addEventListener('click', function(e) {
+ const target = e.target.closest('.j-switch');
+ if (target) {
+ const switcher = target.querySelector('.my-code-wrapper-switcher');
+ const preview = target.parentElement.parentElement.querySelector('.my-code-wrapper-preview-content');
+ const code = target.parentElement.parentElement.querySelector('.my-code-wrapper-content');
+ if (switcher.classList.contains('active')) {
+ switcher.classList.remove('active');
+ preview.classList.add('hidden');
+ code.classList.remove('hidden');
+ } else {
+ switcher.classList.add('active');
+ preview.classList.remove('hidden');
+ code.classList.add('hidden');
+ const codeStr = code.innerText.replace(/\n/g, '');
+ const codeJson = JSON.parse(codeStr);
+ const thead = '| 变量名 | 颜色值 |
';
+ let tbody = '';
+ for (let key in codeJson) {
+ tbody += `| ${key} | |
`;
+ }
+ preview.innerHTML = ``;
+ }
+ }
+ });
+
+
diff --git a/examples/h5.html b/examples/h5.html
index b1d572cb1..59cb68ee9 100644
--- a/examples/h5.html
+++ b/examples/h5.html
@@ -28,7 +28,7 @@
-
+
+
@@ -86,26 +88,26 @@
Sit down: 3: Me
```
-
-
-
-
-
+
+
+
+
+