mirror of https://gitlab.com/curben/blog
fix(heading-link): follow upstream example
https://marked.js.org/using_pro#renderer
This commit is contained in:
parent
cc675429b8
commit
b75c9eaf91
|
@ -54,7 +54,7 @@ To use the old login page, mouse-over on the **Account** link at the top right c
|
|||
|
||||
3. Mouse-over on the **Account** link at the top right corner and click on **My Orders**. It should redirects to `https://login.aliexpress.com/...`
|
||||
|
||||
## "Ignore X-Frame-Options" extension
|
||||
## 'Ignore X-Frame-Options' extension
|
||||
|
||||
[**Ignore X-Frame-Options**](https://addons.mozilla.org/en-US/firefox/addon/ignore-x-frame-options-header/) Firefox extension is a way to whitelist the domain from the restriction. By default, the extension whitelist all domains. This is highly discouraged because it nullifies the security benefits of x-frame-options (e.g. prevent a banking website from being iframe-d inside a phishing website). Instead, we can whitelist the login page only.
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@ const anchorId = (str, transformOption) => {
|
|||
hexo.extend.filter.register('marked:renderer', function (renderer) {
|
||||
const { config } = this
|
||||
const headingId = {}
|
||||
renderer.heading = function ({ text, depth: level }) {
|
||||
renderer.heading = function ({ tokens, depth: level }) {
|
||||
const text = this.parser.parseInline(tokens)
|
||||
const { modifyAnchors } = config.marked
|
||||
const transformOption = modifyAnchors
|
||||
let id = anchorId(text, transformOption)
|
||||
|
|
Loading…
Reference in New Issue