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

Backend traits are not applied on an instance when using backend_traits or backendTraits #904

Closed
ggrossetie opened this issue Apr 8, 2020 · 0 comments · Fixed by #905
Closed

Comments

@ggrossetie
Copy link
Member

The following does not work:

class TemplateConverter {
  constructor () {
    this.baseConverter = processor.Html5Converter.create()
    this.templates = templates
    this.backendTraits = {
      basebackend: 'html5',
      outfilesuffix: '.pdf',
      htmlsyntax: 'html',
      supports_templates: true
    }
  }

  convert (node, transform, opts) {
    const template = this.templates[transform || node.node_name]
    if (template) {
      return template(node, this.baseConverter)
    }
    return this.baseConverter.convert(node, transform, opts)
  }
}
processor.ConverterFactory.register(new TemplateConverter(), ['html5'])
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 a pull request may close this issue.

1 participant