Skip to content

Commit

Permalink
Use the document's name attribute if present
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Apr 3, 2019
1 parent fc01f53 commit 44d67ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/parserPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ module.exports.extractDocumentTitle = callback => {
module.exports.extractSourcePath = (basePath, callback) => {
return parser => {
parser.once('document:end', document => {
if (document.attributes.name) {
callback(document.attributes.name)
return
}

if (!document.attributes.source) {
return
}
Expand Down

0 comments on commit 44d67ee

Please sign in to comment.