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

remove a harmless warning message #26

Merged
merged 2 commits into from
Feb 5, 2019
Merged

remove a harmless warning message #26

merged 2 commits into from
Feb 5, 2019

Conversation

Ritsuka314
Copy link
Collaborator

@Ritsuka314 Ritsuka314 commented Jan 3, 2019

I encountered the following when generating the site using this plugin:

Error: [WARNING] This document format requires a nonempty <title> element.
  Please specify either 'title' or 'pagetitle' in the metadata.
  Falling back to 'Untitled'

What happened is that HTML5, and so does Pandoc, requires a title to be specified for the output.
The warning message is then caught on
this line.
It then propagates to
this line
and triggered
this line
to issue the error.

The issue is that this warning is harmless and should not become an error. So I propose this solution.

I originally wanted to match the result on
this line
to the warning message and filter it out, but turned out that one warning message can span multiple data events, i.e., it can be returned in pieces.
So I decided to wait until the very end to remove this particular warning message.

===

Added on Feb 5, 2019

I found a similar warning message.
This one replaced the previous one since jgm/pandoc@f8879ee#diff-d4eaae919c702ecf1769ce3a7548cc75

Error: [WARNING] This document format requires a nonempty <title> element.
  Please specify either 'title' or 'pagetitle' in the metadata,
  e.g. by using --metadata pagetitle=\"...\" on the command line.
  Falling back to 'Untitled'

I encountered the following when generating the site using this plugin:

```
Error: [WARNING] This document format requires a nonempty <title> element.
  Please specify either 'title' or 'pagetitle' in the metadata.
  Falling back to 'Untitled'
```

What happened is that HTML5, and so does Pandoc, requires a title to be specified for the output.
The warning message is then caught on
[this line](https://github.com/wzpan/hexo-renderer-pandoc/blob/dd837a149e39045b64577a226c5e77c7c39927d9/index.js#L72).
It then propagates to
[this line](https://github.com/wzpan/hexo-renderer-pandoc/blob/dd837a149e39045b64577a226c5e77c7c39927d9/index.js#L82)
and triggered 
[this line](https://github.com/wzpan/hexo-renderer-pandoc/blob/dd837a149e39045b64577a226c5e77c7c39927d9/index.js#L84)
to issue the error.

The issue is that this warning is harmless and should not become an error. So I propose this solution.

I originally wanted to match the result on
[this line](https://github.com/wzpan/hexo-renderer-pandoc/blob/dd837a149e39045b64577a226c5e77c7c39927d9/index.js#L72)
to the warning message and filter it out, but turned out that one warning message can span multiple data events, i.e., it can be returned in pieces.
So I decided to wait until the very end to remove this particular warning message.
@Ritsuka314 Ritsuka314 changed the title remove this harmless warning message remove a harmless warning message Jan 3, 2019
remove one more similar warning
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.

2 participants