Hexo 中 Markdown 特殊字符的处理方法

Hexo Admin保姆级配置指南:从零实现带鉴权的本地写作中心 本文提供Hexo Admin的详细配置指南,帮助用户从零开始构建带鉴权的本地写作中心。涵盖环境准备、鉴权机制、安全配置、高级定制及故障排查,特别适合需要高效安全Markdown写作环境的开发者。 阅读详情

在这里插入图片描述


阅读原文


问题描述

在 Hexo 搭建的博客中对文章进行编写,经常会用到一些特殊字符需要转译,比如 -、.、空格、制表符等等,在正常情况下可以使用 \ 进行转译,但是有一些字符无法转译,使用后在执行 hexo server 命令的时候会报错。

报错信息:

Unhandled rejection Template render error: (unknown path) [Line 7, Column 23]
Error: Unable to call `worldcount`, which is undefined or falsey......


解决方案

报错的原因是,Hexo 编译时发生错误,可能是文章中存在特殊字符,如:{ [ ( ) ] } 等等。如下面这段代码:

在页面中:

{{ worldcount(post.content) }}

在 Markdown 中:

{{ worldcount(post.content) }}

在 Markdown 中使用 \ 无法转译的字符需要使用字符的命名实体或十进制编码,如上面代码中。

注意:需要转义的字符只是文本中的特殊字符,代码块中的特殊字符无需转译或使用转译字符。


常见特殊字符

常用特殊字符转译字符对照表:

特殊符号命名实体十进制编码
空格  
全角空格  
’''
"""
(—(
)—)
<&lt;&#60;
>&gt;&#62;
[—&#91;
]—&#93;
{—&#123;
}—&#125;
´&acute;&#180;
°&deg;&#176;
®&reg;&#174;
©&copy;&#169;

常用数学转译字符对照表:

特殊符号命名实体十进制编码
≤&le;&#8804;
≥&ge;&#8805;
≈&asymp;&#8773;
≠&ne;&#8800;
∩&cap;&#8745;
∪&cup;&#8746;
∠&ang;&#8736;
∞&infin;&#8734;
±&plusmn;&#177;
√&radic;&#8730;
∑&sum;&#8722;
∫&int;&#8747;
Δ&Delta;&#916;

常用希腊字母转译字符对照表:

特殊符号命名实体十进制编码
Φ&Phi;&#934;
Ω&Omega;&#937;
α&alpha;&#945;
β&beta;&#946;
γ&gamma;&#947;
δ&delta;&#948;
ε&epsilon;&#949;
ζ&zeta;&#950;
η&eta;&#951;
θ&theta;&#952;
λ&lambda;&#955;
μ&mu;&#956;
ξ&xi;&#958;
π&pi;&#960;
ρ&rho;&#961;
σ&sigma;&#963;
φ&phi;&#966;
ψ&psi;&#968;
ω&omega;&#969;
∂&part;&#8706;
∅&empty;&#8709;

Word转Markdown实战:跨越格式鸿沟的完整解决方案 文档格式转换是内容管理与技术协作中的常见需求,其核心在于实现不同标记语言或格式间的准确映射。从原理上看,这涉及到将富文本编辑器中的复杂样式和布局指令,解析并转换为轻量级标记语言中简洁、结构化的文本符号。这一过程的技术价值在于提升内容的可移植性、版本控制友好性以及跨平台发布效率,尤其在知识管理、技术文档编写和博客发布等应用场景中至关重要。本文聚焦于解决从Word到Markdown转换过程中的核心痛点,例如**表格转换**难题与**图片处理**策略,通过剖析样式丢失、代码块转义等具体问题,系统性地提供了从工具自 阅读详情

相关推荐

system_stm32f10x.c文件分析

配置系统时钟(包括系统时钟源、锁相环(PLL)倍频系数、高级高性能总线(AHB)/ 高级外设总线(APBx)预分频器以及闪存相关设置)。该函数在系统复位后的启动阶段被调用,且调用时机早于跳转到主程序之前。

Jia shuheng的博客 603

project标签爆红:“unexpected markup <!d (position: START_DOCUMENT seen \r\n<!d... @2:4) maven依赖报错

maven依赖报错 Non-parseable POM xxxx unexpected markup。

weixin_45902573的博客 1万+

stata 代码实现熵值法计算 含常见问题解答

2.标准化①正向指标②负向指标。

m0_74825360的博客 1217

关于Idea 下载Maven依赖时出现的 “unexpected markup <!d (position: START_DOCUMENT seen \r\n<!d... @2:4) “ 错误.

关于Idea 下载Maven依赖时出现的 "unexpected markup

qq_59112776的博客 1万+

CST电子枪仿真实战:从零搭建粒子追踪模型到磁场聚焦优化

本文提供了一份CST电子枪仿真实战指南,详细讲解了从零开始搭建粒子追踪模型的全过程。内容涵盖项目初始化、Track Solver求解器基础、几何建模、粒子源定义,并重点介绍了如何通过引入和优化静磁场(如聚焦线圈配置)来实现电子束的聚焦,帮助工程师高效预测和优化束流品质。

game4的博客 336

模型预测控制 (MPC, Model Predictive Control) 算法详解及案例分析

模型预测控制是一种基于模型的控制策略,通过在线求解一个有限时域的优化问题,预测系统的未来行为,并根据预测结果调整控制输入,以实现系统的稳定性和性能优化。

闲人编程的博客 2936

【bug 教学】Non-parseable POM log4j-bom-2.13.3.pom: unexpected markup <!d (position: START_DOCUMENT seen

解决加载 maven项目时,使用提供的仓库,报错Non-parseable POM log4j-bom-2.13.3.pom: unexpected markup

quentien的博客 1600

BEV和OCC学习-4:数据准备生成pkl文件(NuSences)

info[‘cam_instances’][‘CAM_XXX’][i][‘bbox_3d’]:长度为 7 的列表,以 (x, y, z, l, h, w, yaw) 的顺序表示实例的 3D 边界框。info[‘cam_instances’][‘CAM_XXX’][i][‘bbox’]:2D 边界框标注(3D 框投影的矩形框),顺序为 [x1, y1, x2, y2] 的列表。info[‘cam_instances’][‘CAM_XXX’][i][‘attr_label’]:实例的属性标签。

zfjBIT的专栏 1699

Maven依赖安装报错unexpected markup <!d (position: START_DOCUMENT seen \r\n<!d...

然后删除出问题的依赖文件,重新下载依赖就解决问题了。之前配置的阿里镜像有问题。

Flythewag的博客 2815

DeepSeek+Dify之一安装部署

DeepSeek添加知识库

yilvyangguang520的博客 1544

一篇文章带你搞定数学建模中的线性回归模型(05年长江水质问题示例讲解含代码)

文章目录一、问题分析二、原理讲解三、MATLAB 实现线性回归模型 一、问题分析 根据你的预测分析,如果未来10年内每年都要求长江干流的Ⅳ类和Ⅴ类水的比例控制在20%以内,且没有劣Ⅴ类水,那么每年需要处理多少污水 为了达到题目中所要求的水质,可建立废水排放量与各类水百分比之间的二元线性回归模型,对未来十年的废水排放量进行预测,并确定其与各类水所占百分比之间的函数关系式。通过此关系式,可以计算在这种情况下长江所能承受的最大污水排放量,将这个排放量与预测的排放量进行比较,多出来的部分就是需要每年处理掉的。 二、

南淮北安的博客 2165

Hexo文章发布

Hexo文章发布 文章创建 $ hexo new [layout] <title> 此处layout可以选择,也可以不选择。 layout指定文章的布局,默认Post ,可以通过修改 _config.yml 中的 default_layout 参数来指定默认布局 此命令会在/source/_posts下创建一个文件名 title.md文件,然后就可以使用markdown编辑...

Hemx的博客 483

PyQt(Python+Qt)学习随笔:PyQt界面派生类构造方法中super方法的使用

老猿Python博文目录 专栏:使用PyQt开发图形界面Python应用 老猿Python博客地址 在《第15.7节 PyQt入门学习:PyQt5应用构建详细过程介绍》和订阅专栏《第二章、PyQt5应用构建详细过程介绍》中,老猿介绍界面派生类的构造方法如下: class MediaPlayerWin(QtWidgets.QWidget,Ui_UI_PlayerWin): def __i...

老猿Python 2711

Hexo博客写作指南:Markdown与Front-matter详解

Markdown作为一种轻量级标记语言,已成为技术文档和博客写作的行业标准。其核心原理是通过简单符号实现内容结构化,兼具易读性和可转换性。在静态网站生成领域,Hexo等工具通过解析Markdown文件生成静态页面,配合Front-matter元数据实现SEO优化和内容管理。本文以Hexo为例,详解如何通过VS Code插件链、标准化YAML配置和图床工具构建高效写作工作流,解决90%新手遇到的Front-matter格式错误和图片管理问题,特别适用于技术博客和文档站点的持续维护场景。

weixin_34080571的博客 688

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

hexo 异常处理

D:\mxz_code\my-github\blog-source>hexo s INFO Validating config WARN Deprecated config detected: "use_date_for_updated" is deprecated, please use "updated_option" instead. See https://hexo.io/docs/configuration for more details. INFO Start processing

微信公众号: 后端码匠 639

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

如何迁移现有博客到Mediator主题:WordPress、Hexo等平台迁移指南

Mediator是一款受Medium启发的Jekyll主题,它能帮助你快速搭建简洁优雅的博客系统。本指南将详细介绍如何从WordPress、Hexo等主流平台无缝迁移到Mediator主题,让你的博客焕发新生。 ## 为什么选择Mediator主题? Mediator主题以其简约的设计风格和优秀的阅读体验受到众多博主的喜爱。它基于Jekyll构建,静态生成的特性让博客加载速度更快,同时支持Ma

gitblog_00527的博客 1116

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

Hexo在Github中搭建博客系统(5)Markdown语法

前面我们已经知道怎么搭博客系统、发布、创建文章,现在到了创建内容的时候,需要熟练掌握Markdown的语法基本语法(0) 特殊字符之所以把特殊字符放到最前面,就是因为Markdown对特殊字符处理不是很友好,很容易出现很奇怪的异常,其实就是因为文章中包含了特殊字符无法编译通过导致Hexo无法渲染 在写博客时,一定注意不要写这些字符,如果要写,就进行转义 有些人可能说可以使用反斜杠 \ 来处理,我

大大的微笑的专栏 1万+

Hexo在Github中搭建博客系统(6)异常处理

异常这里主要收集Hexo在搭建博客的时候出现的异常以及处理方案在进行启动服务器模拟查看时hexo s –debug出现的启动异常(1) 无法执行now函数异常1.1 异常内容13:51:28.741 FATAL (unknown path) [Line 7, Column 533] Error: Unable to call `now`, which is undefined or falsey

大大的微笑的专栏 8642

hexo博客git报错

一、意外的标记异常 1.异常内容: xxx:blog xxxx$ hexo g INFO Start processing FATAL Something’s wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html Template render error: unexpected...

AomanHao的博客 695

markdown中实现首行缩进的两种方法

markdown中实现首行缩进的两种方法  由于markdown语法主要考虑的是英文,所以对于中文的首行缩进并不太友好,两种方法都可以完美解决这个问题。 把输入法由半角改为全角。 两次空格之后就能够有两个汉字的缩进。 在开头的时候,先输入下面的代码,然后紧跟着输入文本即可。分号也不要掉。 直接写半方大的空白 或  全方大的空白 或  不断行的空白格&nb

祝 枫 9万+

处理hexo博客中mathjax与marked.js冲突

例如会把’_’转义成 见 http://blog.youkuaiyun.com/emptyset110/article/details/50123231

songtoy的博客 1851

Hexo Butterfly 主题图片无法显示问题解决方案

摘要:本文详细解决Hexo Butterfly主题图片无法显示问题。主要原因是本地绝对路径、资源路径不匹配及格式错误。解决方案包括:1)配置post_asset_folder为true;2)创建同名资源文件夹存放图片;3)修改图片引用为仅文件名相对路径;4)预览验证。同时提供常见问题排查和最佳实践建议,如避免本地路径、注意大小写等。遵循这些步骤可确保图片正常显示。

Aetik的博客 240

高效转换优快云博客为Markdown:自动化工具与批量处理技巧

本文详细介绍了如何高效将优快云博客转换为Markdown格式的自动化工具与批量处理技巧。通过Node.js环境搭建、clean-mark工具使用、图片水印处理及批量转换方案,帮助技术写作者快速迁移博客内容,提升工作效率。特别推荐优快云官方API作为终极解决方案,确保格式100%还原。

weixin_29230649的博客 312
下一篇: 前端优化 —— 函数的节流和防抖
Panda Shen
博客等级 码龄10年 18粉丝 50原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值