From 815fc5a61ad20d3ebd006528d00a2ca3e389e1a8 Mon Sep 17 00:00:00 2001 From: Cerallin Date: Thu, 19 Oct 2023 14:47:17 +0800 Subject: [PATCH] Publish v1.2.5 --- lib/filter.js | 7 ++++--- package-lock.json | 10 +++++++++- package.json | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/filter.js b/lib/filter.js index be30e15..cf05c1d 100644 --- a/lib/filter.js +++ b/lib/filter.js @@ -67,9 +67,10 @@ module.exports = function (text_autospace_filter) { this.process = function (str) { const document = parse5.parse(str); - const html = treeAdapter.getChildNodes(document)[1]; - // Match and insert placeholder tags - searchElement(html, entry).forEach(filter) + for (const html of treeAdapter.getChildNodes(document)) { + // Match and insert placeholder tags + searchElement(html, entry).forEach(filter) + } // Serialize and return return parse5.serialize(document); diff --git a/package-lock.json b/package-lock.json index ebff04c..05007f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "hexo-filter-text-autospace", - "version": "1.1.5", + "version": "1.2.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2212,6 +2212,14 @@ "whatwg-url": "^8.5.0", "ws": "^7.4.5", "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + } } }, "jsesc": { diff --git a/package.json b/package.json index 0704e1f..f0d4012 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-filter-text-autospace", - "version": "1.2.4", + "version": "1.2.5", "description": "A hexo plugin to insert spaces between CJK chars and latin chars.", "main": "index.js", "scripts": {