Skip to content

Commit ee9994e

Browse files
committed
fix: 修复使用空值时的链接处理逻辑,确保 href 和 src 属性的正确获取
1 parent 4ed62dc commit ee9994e

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

assets/js/a.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default function formatLink(html, whitelist = ["*.jx3box.com"], strict =
9090

9191
$("a[href]").each((_, el) => {
9292
const a = $(el);
93-
const hrefRaw = a.attr("href") ?? "";
93+
const hrefRaw = a.attr("href") || "";
9494
const href = String(hrefRaw).trim();
9595
if (!href) return;
9696

assets/js/iframe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default function iframeFilter(html, whitelist, options = {}) {
8181

8282
$("iframe").each((_, el) => {
8383
const iframe = $(el);
84-
const srcRaw = iframe.attr("src") ?? "";
84+
const srcRaw = iframe.attr("src") || "";
8585
const src = String(srcRaw).trim();
8686
if (!src) return;
8787

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jx3box/jx3box-editor",
3-
"version": "2.2.43",
3+
"version": "2.2.44",
44
"description": "JX3BOX Article & Editor",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)