Skip to content

fix: prevent firstLine being parsed as a string#67

Merged
curbengh merged 1 commit intohexojs:masterfrom
curbengh:line-number
Aug 7, 2019
Merged

fix: prevent firstLine being parsed as a string#67
curbengh merged 1 commit intohexojs:masterfrom
curbengh:line-number

Conversation

@curbengh
Copy link
Contributor

@curbengh curbengh commented Aug 4, 2019

firstLine variable sometimes can be parsed as a string.
let say, firstLine = 1; firstLine + 3 can results in 13, instead of expected 4.

See hexojs/hexo#3646

@curbengh
Copy link
Contributor Author

curbengh commented Aug 4, 2019

It's not supposed to be parsed as a string though,

const firstLine = 1;
const i = 2;
const check = `<span class="line">${firstLine + i}</span><br>`
console.log(check)

works as expected.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.358% when pulling 2a7f79f on curbengh:line-number into 5005990 on hexojs:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.358% when pulling 2a7f79f on curbengh:line-number into 5005990 on hexojs:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.358% when pulling 2a7f79f on curbengh:line-number into 5005990 on hexojs:master.

@curbengh curbengh requested a review from a team August 7, 2019 02:14
Copy link
Contributor

@tomap tomap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we still don't fully understand the cause of this issue.
Maybe we don't need to :)

@curbengh
Copy link
Contributor Author

curbengh commented Aug 7, 2019

My guess is that hexo parse output of hexo-util as string, maybe too aggressively.

@curbengh curbengh merged commit ab30d63 into hexojs:master Aug 7, 2019
@curbengh curbengh deleted the line-number branch August 7, 2019 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants