From b75c9eaf915fc8aa4a5a3e729b745f91c5a366ae Mon Sep 17 00:00:00 2001 From: Ming Di Leom <2809763-curben@users.noreply.gitlab.com> Date: Thu, 16 Jan 2025 11:19:38 +0000 Subject: [PATCH] fix(heading-link): follow upstream example https://marked.js.org/using_pro#renderer --- source/_posts/aliexpress-no-login-firefox.md | 2 +- themes/chameleon/scripts/heading-link.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/_posts/aliexpress-no-login-firefox.md b/source/_posts/aliexpress-no-login-firefox.md index fd7bdb7..bc26f03 100644 --- a/source/_posts/aliexpress-no-login-firefox.md +++ b/source/_posts/aliexpress-no-login-firefox.md @@ -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. diff --git a/themes/chameleon/scripts/heading-link.js b/themes/chameleon/scripts/heading-link.js index 6feab1f..338b2f4 100644 --- a/themes/chameleon/scripts/heading-link.js +++ b/themes/chameleon/scripts/heading-link.js @@ -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)