Open
Description
The condition if (rawHtml === "")
is always false since we prepend HTML to the variable rawHtml
:
graphgist-portal-v3/api/src/graphgists/utils.js
Lines 96 to 104 in 20efc9c
As a result, the ValidationError
will never be thrown.
Furthermore, it would be better to use an Asciidoctor Postprocessor extension to prepend content: https://docs.asciidoctor.org/asciidoctor/latest/extensions/postprocessor/
Here's an example (untested code):
metadata-postprocessor.js
module.exports = function (registry) {
registry.postprocessor(function () {
var self = this
self.process(function (doc, output) {
const attributes = doc.getAttributes()
return `${output}<span id="metadata" author="${attributes['author'] || ''}" version="${attributes['neo4j-version'] || ''}" twitter="${attributes['twitter'] || ''}" tags="${attributes['tags'] || ''}" />`
})
})
}
And then you can register this extension:
const asciidoctor = require('asciidoctor')()
const registry = asciidoctor.Extensions.create()
// register the extension
const metadataPostProcessorExtension = require('./metadata-postprocessor.js')
metadataPostProcessorExtension(registry)
// convert text using the extension registry
asciidoctor.convert('text', { 'extension_registry': registry })
Metadata
Metadata
Assignees
Labels
No labels