Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #3285
已知问题
原有的 spoiler 文本功能只能处理单个文本节点内的 spoiler 标签,无法处理跨越多个 DOM 节点的情况。所以,当文本内容包含复杂格式(如加粗、斜体、公式等)时,隐藏效果失效。
解决方案
增加跨节点处理功能:
processCrossNodeSpoilers
函数,使用innerHTML
和正则表达式处理跨节点的 spoiler 标签/NotionPage.js
中的调用方式兼容改动收益
package.json
读取具体改动
/public/js/spoilerText.js
测试确认