Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前端渲染 mathjax 时,本地搜索的高亮功能会破坏含有高亮文字的公式段 #782

Closed
3 tasks done
JoyWonderful opened this issue Apr 4, 2024 · 1 comment
Labels
Bug Something isn't working

Comments

@JoyWonderful
Copy link

Issue Checklist

Expected behavior

公式在前端正常被 mathjax 渲染

Actual behavior

  • Links to demo site with this issue: here
  • Links to repository or source code of the blog: here
  • Screenshots: math-highlibrok

截图中,下方是正确渲染的(没有 highlight= 参数),上方是被 highlight=进制 参数高亮所破坏的公式(页面已经加载完成)。

我测试了一下,NexT 主题的的文档网站也有这个问题,在公式示例页面的网址后添加参数 highlight=e 后,e=mc^2 的公式渲染被破坏了。如图:

math-nextdocbrok.png

Steps to reproduce the behavior

在网址后添加 highlight= 参数,与公式内容有重合时(公式内容被高亮),公式就无法在前端被正常渲染。未重合的公式可以正常渲染。
也就是在本地搜索框中的结果链接。

像这样:
just-abrok.jpeg

Node.js and NPM Information

node: v18.16.0
npm: 9.5.1

Package dependencies Information

Hexo Configuration

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: JoyWonderful的小窝
subtitle: Be HardWorking Every Day.
description: ''
keywords:
author: JoyWonderful
language: zh-CN
timezone: ''

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://joywonderful.github.io
permalink: /posts/:title/
permalink_defaults:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: false
  line_number: false
  auto_detect: false
  tab_replace: ''
  wrap: false
  hljs: false
prismjs:
  enable: true
  preprocess: true
  line_number: false
  tab_replace: ''

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 5
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'mtime'

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repository: [email protected]:JoyWonderful/joywonderful.github.io.git
  branch: main

NexT Configuration

math:
  # Default (false) will load mathjax / katex script on demand.
  # That is it only render those page which has `mathjax: true` in front-matter.
  # If you set it to true, it will load mathjax / katex script EVERY PAGE.
  every_page: false

  mathjax:
    enable: true
    # Available values: none | ams | all
    tags: none

  katex:
    enable: false
    # See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex
    copy_tex: false

Other Information

Broswer: Edge 123.0.2420.65

@JoyWonderful JoyWonderful added the Bug Something isn't working label Apr 4, 2024
Copy link

welcome bot commented Apr 4, 2024

Thanks for opening this issue, maintainers will get back to you as soon as possible!

@JoyWonderful JoyWonderful closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant