hexo blog code block can only copy the first line of code you can not copy text, code blocks decline line problem solving

EDITORIAL

Today, get blog I found a very strange question, copy the code function block can only copy the first line of code. The problem is mainly due to problems caused by hexo version, this paper describes a solution to this problem, the article may have many shortcomings, please understand, welcome Gangster comments.

As used herein, the thing

  1. win10 computer
  2. hexo4.0.0

1. Problem Description

1. Click on the article copy only the first line of code, at first I thought it was the subject, because the code is the theme I use the copy function provided
Here Insert Picture Description

2. View html source code, I found my source of a lot more than others tr tag, my source is a single line of code tr tag, while big brother blog all the code a tr tag, different lines of code with br tag separated. I thought it was markdown parser. View source parser spent a lot of time, did not find the problem. Later versions of the parser think it might be too high, then reduced version, or no effect.

Gangster blog code is as follows:
Here Insert Picture Description
I blog code is as follows:
Here Insert Picture Description

3. Since it is not a problem parser, then I'll put hexo above suspicion, because I hexo version is also high, the default is the highest version just installed. Facts have proved that I was right. I installed the hexo4.0.0 version, re-install version 3.0 after I uninstalled, the problem successfully resolved.

Only a tr tag
Here Insert Picture Description

Click to copy all the contents of the code:
Here Insert Picture Description

2. Problem Solving

1. Open the blog root directory, enter the following command git right open, uninstall hexo

npm uninstall hexo
//如果配置了数据源可以使用下面的命令
cnpm uninstall hexo

2. Install version hexo3.0

npm install hexo@3.0 --save
//如果配置了数据源可以使用下面的命令
cnpm install hexo@3.0 --save

3. re-run hexo, the problem is solved.

New questions added, found (important)

Every day the computer may not the same situation, there will be some fallback dependency problems.

Execute the following code to see the missing dependencies

npm ls --depth 0

Here Insert Picture Description
And install it manually.

npm i 依赖名 --save

If still no solution, it is recommended to re-build a blog directory, and then re-install dependencies, will be copied into blog content.
" " It hexo initseems the highest version can only be installed by default, after installation or according to the above steps rollback, nausea. If there is still hope to understand the big brother to guide the guidance = _ =

3. Summary

A very simple version of the problem, the results I do most of the day, was originally thought was just a small bug, or experience in dealing with the problem of not enough ah. There are ambiguities Comments welcome, I would see the reply. This article is over, what are deficiencies please feel free to correct me.

Published 38 original articles · won praise 17 · views 1245

Guess you like

Origin blog.csdn.net/nineya_com/article/details/103451357