fix: compatibility with cheerio 1.0.0+ (#3313)#3315
Merged
yoshinorin merged 3 commits intohexojs:masterfrom Oct 28, 2018
Merged
fix: compatibility with cheerio 1.0.0+ (#3313)#3315yoshinorin merged 3 commits intohexojs:masterfrom
yoshinorin merged 3 commits intohexojs:masterfrom
Conversation
Contributor
Author
|
I should create a test case, learning... Edit: Added a test case. |
yoshinorin
requested changes
Oct 28, 2018
| @@ -0,0 +1,28 @@ | |||
| 'use strict'; | |||
|
|
|||
| const should = require('chai').should(); // eslint-disable-line | |||
Member
There was a problem hiding this comment.
We were changed to use globally chai.should in this commit.
So, no need this line.
| const should = require('chai').should(); // eslint-disable-line | ||
|
|
||
| describe('Meta Generator', function() { | ||
| const Hexo = require('../../../lib/hexo'); |
Member
There was a problem hiding this comment.
Now, We are migrating hexo code to ES6 syntax.
Would you please change to arrow function ? Also others.
Member
|
Other implementation and test code I will review later. |
yoshinorin
approved these changes
Oct 28, 2018
Member
|
LGTM! Thanks! |
|
I think this caused the problem. Can you fix it? |
Closed
11 tasks
This was referenced Aug 6, 2019
2 tasks
2 tasks
2 tasks
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #3313. Related to #3129.
<html><head><body>are automatically added to every empty or open tag (see Automatically adding <html><head><body> ? cheeriojs/cheerio#1031 All examples are broken for v1.0.0 (rc2) - cheerio outputs html-tags cheeriojs/cheerio#1239). If I have<p>, it will results in,<head>. e.g.<html><head><body>are stripped away in the final$.html(), leavingAs a workaround, meta_generator.js prepend only to non-empty real
<head>. I assume Hexo page has at least meta charset or css in the<head>.Without this workaround, if I use any plugin that uses cheerio 1.0.0+ (e.g. hexo-nofollow), meta_generator will also prepend tag to
<body>(see curbengh/hexo-testing@f4824bb).Thank you for creating a pull request to contribute to Hexo code! Before you open the request please review the following guidelines and tips to help it be more easily integrated:
cc @h404bi