Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upgatsby-transformer-asciidoc fails when doc doesn't have title #27714
Comments
|
According to https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#document-header the title can be optional so feel free to send in a PR checking for its existence. |


Description
If you have a adoc without a title, say:
You'll get a cryptic error:
This looks like an issue in gatsby-transformer-asciidoc/src/gatsby-node.js L91:
where there's no check if title is undefined or null.
Steps to reproduce
(shown above)
Expected result
Either (a) things should work or (b) some sensible error like "You must specify a title" is shown
Actual result
Environment
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.19.0 - ~/.nvm/versions/node/v12.19.0/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v12.19.0/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 86.0.4240.111
Firefox: 81.0.2
Safari: 14.0
npmPackages:
gatsby: ^2.24.85 => 2.24.85
gatsby-plugin-react-head: ^1.1.0 => 1.1.0
gatsby-plugin-sass: ^2.3.22 => 2.3.22
gatsby-source-filesystem: ^2.3.37 => 2.3.37
gatsby-transformer-asciidoc: ^1.3.15 => 1.3.15
npmGlobalPackages:
gatsby-cli: 2.12.113