惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
Spread Privacy
Spread Privacy
I
InfoQ
V
V2EX
S
Schneier on Security
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
The Hacker News
The Hacker News
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Latest news
Latest news
S
Secure Thoughts
Project Zero
Project Zero
MongoDB | Blog
MongoDB | Blog
I
Intezer
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
N
Netflix TechBlog - Medium
V2EX - 技术
V2EX - 技术
量子位
T
Threatpost
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
T
Tor Project blog
A
Arctic Wolf
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
博客园 - Franky
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
L
LINUX DO - 热门话题

飞絮落叶雪 - typecho

Typecho 几个小插件分享 Tpyecho 集成 Artalk 折腾小记 独立博客自省问卷15题 您的邮箱被管理员屏蔽无法评论 typecho CMS主题下载 垃圾站复活记 给博客添加几个小功能 typecho显示exif信息 整了一个typecho归档页面
修改typecho的md解析器支持脚注
Mr.He · 2017-10-24 · via 飞絮落叶雪 - typecho
2017-11-13更新:此项功能在typecho新版本中已经集成,无需更改即可实现。

用过markdown的同学都知道,原生是不支持脚注的。

开源的东西就在于我们可以修改它,使之符合我们的口味。

随着知识在互联网的普及,我们越来越多地需要从网上收集各种信息,很多网站都是用了知识共享署名-非商业性使用-禁止演绎 3.0 中国大陆许可协议许可,如本站,拿来可以非商业使用,但是需要注明出处,这样也有好处,既能让知识共享,又能让作者的付出得到尊重。

之前老何的博客引用都是直接在原文添加相应链接,而fooleap同学的文章1比较高深,看不懂,只能作罢。

今天逛官方论坛的时候,发现开发版2支持新的md语法,于是升级到1.1(17.10.13版),果然支持,但是还不够完美,于是又找到新的解析方法3,复制里面的文件内容,复制到var/HyperDown.php文件里,恩,能实现了,开心。

不过它的注脚还是只是一个1字,不容易看到,于是再修改,在HyperDown.php的295行,改成其中注是注字的Unicode编码,具体效果看本文就知道了。

"<sup id=\"fnref-{$id}\"><a href=\"#fn-{$id}\" class=\"footnote-ref\">[&#27880;{$id}]</a></sup>"

不过根据实际情况,对css进行相应的添加或者修改,我的css如下:

.fn a {
    color: #08d;
}
.fn a:hover{
    color: #f00;
}
.footnotes ol {
    -webkit-margin-after: 1em;
    -webkit-margin-start: 0px;
    -webkit-margin-end: 0px;
    padding-left: 20px;
    display: block;
   font-size: 14px;
}
.footnotes ol li{
list-style-type: decimal;
}

经过这样一番改造,我们就可以使用md语法来达到脚注的目的。
例如:

我是老何[^1]
[^1]: 老何是本博客的博主。

参考资料