feat: 移除 Mermaid 支持并创建需求文档
- 从 settings.php 移除 Mermaid 设置项和选项保存逻辑 - 从 functions.php 移除 Mermaid 代码块预处理函数 - 从 footer.php 移除 Mermaid 加载和渲染代码 - 从 style.css 移除 Mermaid 图表样式 - 删除本地镜像文件 assets/vendor/external/mermaid/ - 创建 mermaid-support-requirements.md 需求文档 原因:WP-Markdown 编辑器保存的 Markdown 源文件中 Mermaid 代码是一整行, 没有真正的换行符,导致 Mermaid 解析器持续报错。所有尝试的解决方案均失败。 需求文档中详细说明了问题原因和推荐的替代方案。
This commit is contained in:
88
settings.php
88
settings.php
@@ -2824,80 +2824,6 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-mermaid"><?php _e('Mermaid 图表', 'argon');?></h3></th></tr>
|
||||
|
||||
<tr>
|
||||
|
||||
<th><label><?php _e('启用 Mermaid 图表渲染', 'argon');?></label></th>
|
||||
|
||||
<td>
|
||||
|
||||
<select name="argon_enable_mermaid">
|
||||
|
||||
<?php $argon_enable_mermaid = get_option('argon_enable_mermaid', 'false'); ?>
|
||||
|
||||
<option value="false" <?php if ($argon_enable_mermaid=='false'){echo 'selected';} ?>><?php _e('不启用', 'argon');?></option>
|
||||
|
||||
<option value="true" <?php if ($argon_enable_mermaid=='true'){echo 'selected';} ?>><?php _e('启用', 'argon');?></option>
|
||||
|
||||
</select>
|
||||
|
||||
<p class="description"><?php _e('启用后,文章中的 Mermaid 代码块会被自动渲染为图表。使用方式:在代码块中指定语言为 mermaid', 'argon');?></p>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
<th><label><?php _e('Mermaid 配置', 'argon');?></label></th>
|
||||
|
||||
<td>
|
||||
|
||||
<label style="display: block; margin-bottom: 10px;">
|
||||
|
||||
<input type="checkbox" name="argon_mermaid_use_local" value="true" <?php if (get_option('argon_mermaid_use_local')=='true'){echo 'checked';}?>/>
|
||||
|
||||
<?php _e('使用本地镜像', 'argon');?>
|
||||
|
||||
</label>
|
||||
|
||||
Mermaid CDN <?php _e('地址', 'argon');?>:
|
||||
|
||||
<input type="text" class="regular-text" name="argon_mermaid_cdn_url" value="<?php echo get_option('argon_mermaid_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js' : get_option('argon_mermaid_cdn_url'); ?>"/>
|
||||
|
||||
<p class="description"><?php _e('默认为', 'argon');?> <code>//cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js</code><br/><?php _e('勾选"使用本地镜像"后将优先使用主题内置的完整版本', 'argon');?></p>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
<th><label><?php _e('Mermaid 主题', 'argon');?></label></th>
|
||||
|
||||
<td>
|
||||
|
||||
<select name="argon_mermaid_theme">
|
||||
|
||||
<?php $argon_mermaid_theme = get_option('argon_mermaid_theme', 'default'); ?>
|
||||
|
||||
<option value="default" <?php if ($argon_mermaid_theme=='default'){echo 'selected';} ?>><?php _e('默认', 'argon');?></option>
|
||||
|
||||
<option value="forest" <?php if ($argon_mermaid_theme=='forest'){echo 'selected';} ?>><?php _e('森林', 'argon');?></option>
|
||||
|
||||
<option value="dark" <?php if ($argon_mermaid_theme=='dark'){echo 'selected';} ?>><?php _e('暗色', 'argon');?></option>
|
||||
|
||||
<option value="neutral" <?php if ($argon_mermaid_theme=='neutral'){echo 'selected';} ?>><?php _e('中性', 'argon');?></option>
|
||||
|
||||
</select>
|
||||
|
||||
<p class="description"><?php _e('选择 Mermaid 图表的配色主题', 'argon');?></p>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-lazyload">Lazyload</h3></th></tr>
|
||||
|
||||
<tr>
|
||||
@@ -6807,20 +6733,6 @@ function argon_update_themeoptions(){
|
||||
|
||||
argon_update_option('argon_lazyload_loading_style');
|
||||
|
||||
//Mermaid 相关
|
||||
|
||||
argon_update_option('argon_enable_mermaid');
|
||||
|
||||
argon_update_option('argon_mermaid_cdn_url');
|
||||
|
||||
argon_update_option('argon_mermaid_theme');
|
||||
|
||||
argon_update_option_checkbox('argon_mermaid_use_local');
|
||||
|
||||
argon_update_option_checkbox('argon_mermaid_use_local');
|
||||
|
||||
|
||||
|
||||
//图片缩放预览相关
|
||||
|
||||
argon_update_option('argon_enable_fancybox');
|
||||
|
||||
Reference in New Issue
Block a user