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

Issue 2234 notes missing #2242

Merged
merged 4 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cypress/integration/notes_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe('notes plugin', () => {
beforeEach(() => {
cy.visit('guides/references/configuration.html')
})

it('notes render', () => {
cy.get('blockquote.note')
})
})
4 changes: 2 additions & 2 deletions lib/tags/note.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function note (hexo, args, content) {
rawRender(hexo, text, { engine: 'markdown' })

const stripSurroundingParagraph = (text) => {
return text.replace(/^<p>/, '').replace(/<\/p>$/, '')
return text.replace(/^<p>/, '').replace(/<\/p>\n?$/, '')
}

const renderHeader = (params) => {
Expand All @@ -49,7 +49,7 @@ module.exports = function note (hexo, args, content) {
})
}

Promise.all([
return Promise.all([
toMarkdown(content),
renderHeader(args),
])
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"predeploy": "NODE_ENV=production npm run build",
"scrape": "node ./cy_scripts/scrape.js",
"start-server": "node --stack-size=8192 ./index.js server --port 2222",
"prestart": "gulp pre:build",
"start": "npm run start-server -- --no-validate",
"test-e2e": "start-server-and-test start http://localhost:2222 cypress:run",
"dev": "start-test 2222 cypress:open",
Expand Down