next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.48k stars 438 forks source link

输入的单引号会被自动替换 #568

Closed zhmou closed 2 years ago

zhmou commented 2 years ago

Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate. 请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist


Expected behavior

在Markdown文件中 输入 单引号 '(Unicode编码 U+0027)、双引号"(U+0022)进行测试: image

默认主题landscape的行为: image 这五行引号的Unicode分别为: U+2019 ’ (和原文件中的Unicode不同) U+201D ” (和原文件中的Unicode不同) U+2019 ’ (和原文件中的Unicode不同) U+0027 ' U+0027 '

Actual behavior

网站:https://zhmou.github.io/2022/09/12/only-for-test/ 在Next主题下的行为 image 这五行引号的Unicode分别为: U+2019 ’ (和原文件中的Unicode不同) U+0022 " (和原文件中的Unicode相同) U+0027 ' (和原文件中的Unicode相同) U+2019 ’ U+2019 ’

Steps to reproduce the behavior

新建博文,英文键盘模式下输入各种 ' 进行测试。

Environment Information

Node.js and NPM Information

$ node -v
v18.8.0
$ npm -v
8.18.0

Package dependencies Information

$ npm ls --depth 0
hexo-site@0.0.0 E:\blog
├── hexo-deployer-git@2.1.0
├── hexo-generator-archive@1.0.0
├── hexo-generator-category@1.0.0
├── hexo-generator-index@2.0.0
├── hexo-generator-searchdb@1.4.0
├── hexo-generator-tag@1.0.0
├── hexo-renderer-ejs@1.0.0
├── hexo-renderer-markdown-it@5.0.0 (git+ssh://git@github.com/hexojs/hexo-renderer-markdown-it.git#c33b31d5ad34ffa4debee3ae6dc098617090b449)
├── hexo-renderer-stylus@2.0.1
├── hexo-server@2.0.0
├── hexo-theme-next@8.11.1
├── hexo-word-counter@0.0.3
├── hexo@5.2.0
├── markdown-it-abbr@1.0.4
├── markdown-it-container@3.0.0
├── markdown-it-deflist@2.1.0
├── markdown-it-emoji@2.0.0
├── markdown-it-footnote@3.0.2
├── markdown-it-imsize@2.0.1
├── markdown-it-ins@3.0.0
├── markdown-it-mark@3.0.0
├── markdown-it-mathjax@2.0.0
├── markdown-it-regexp@0.4.0
├── markdown-it-sub@1.0.0
├── markdown-it-sup@1.0.0
└── markdown-it-task-checkbox@1.0.6

Hexo Configuration

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

# Site
title: Zh某的备忘录
subtitle: '记录生活点滴'
description: '不断学习 关注技术 热爱生活'
keywords: 
author: Zhmou
language: zh-CN
timezone: 'Asia/Shanghai'

# URL
## If your site is put in a subdirectory, set url as 'http://example.com/child' and root as '/child/'
url: http://zhmou.github.io/
root: /
permalink: :year/:month/:day/: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: :year-:month-:day-: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: true
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: true
  line_number: true
  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: 10
  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: https://github.com/zhmou/zhmou.github.io.git
  branch: main
# Markdown-it config
# Docs: https://github.com/hexojs/hexo-renderer-markdown-it/wiki

markdown:
  render:
    html: true
    xhtmlOut: false
    breaks: true
    linkify: true
    typographer: true
    quotes: '“”‘’'
  plugins:
    - markdown-it-abbr
    - markdown-it-footnote
    - markdown-it-ins
    - markdown-it-mathjax
    - markdown-it-deflist
    - markdown-it-imsize
    - markdown-it-mark
    - markdown-it-regexp
    - markdown-it-task-checkbox
    - name: markdown-it-container
      options: success
    - name: markdown-it-container
      options: info
    - name: markdown-it-container
      options: warning
    - name: markdown-it-container
      options: danger
    - markdown-it-deflist
    - name: markdown-it-emoji
      options:
        shortcuts: {}
  anchors:
    level: 1
    collisionSuffix: 'v'
    permalink: true
    permalinkClass: header-anchor
    permalinkSymbol: ''

search:
  path: search.xml
  field: post
  content: true
  format: htmls

# https://github.com/next-theme/hexo-word-counter
symbols_count_time:
  symbols: true
  time: true
  total_symbols: true
  total_time: true
  exclude_codeblock: false
  awl: 4
  wpm: 100
  suffix: "分钟"

NexT Configuration

  custom_file_path:
    variable: source/_data/variables.styl
    style: source/_data/styles.styl
  creative_commons:
    # Available values: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | cc-zero
    license: by-nc-sa
    # Available values: big | small
    size: small
    sidebar: false
    post: false
    language: deed.zh
  menu:
    home: / || fa fa-home
    tags: /tags/ || fa fa-tags
    categories: /categories/ || fa fa-th
    archives: /archives/ || fa fa-archive
    links: /links/ || fa fa-link
    about: /about/ || fa fa-user
  # Sidebar Avatar
  avatar:
    # Replace the default image and set the url here.
    url: /img/general/avatar.jpg
    # If true, the avatar will be displayed in circle.
    rounded: true
    # If true, the avatar will be rotated with the cursor.
    rotated: true
  busuanzi_count:
    enable: true
    total_visitors: true
    total_visitors_icon: fa fa-user
    total_views: true
    total_views_icon: fa fa-eye
    post_views: true
    post_views_icon: far fa-eye

Other Information

welcome[bot] commented 2 years ago

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

stevenjoezhang commented 2 years ago

这个不是主题的问题,引号是 Hexo 的 markdown 插件负责替换的。具体可以参考 https://github.com/theme-next/hexo-theme-next/issues/462#issuecomment-435429592

zhmou commented 2 years ago

感谢解答。

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.