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

Make the SyntaxHighlighterBase.$format method easily accessible to syntax highlighters #1220

Closed
djencks opened this issue Feb 28, 2021 · 0 comments · Fixed by #1682
Closed

Comments

@djencks
Copy link
Contributor

djencks commented Feb 28, 2021

Currently a javascript syntax highlighter format method has to do this to call the 'superclass method':

const toHash = function (object) {
  return object && !object.$$is_hash ? Opal.hash2(Object.keys(object), object) : object
}
return Opal.send(this, Opal.find_super_dispatcher(this, 'format', this.$format), [node, lang, toHash(opts)])

It would be considerably more convenient, and avoid the need to import Opal, if this could be hidden in the superclass/adapter so one could write:

this.super.format(node, lang, opts)

https://gitlab.com/djencks/asciidoctor-highlight.js-build-time could provide a test case.

@ggrossetie ggrossetie added this to the v3.0.x milestone Aug 23, 2022
ggrossetie added a commit to ggrossetie/asciidoctor.js that referenced this issue Jan 10, 2023
ggrossetie added a commit to ggrossetie/asciidoctor.js that referenced this issue Jan 11, 2023
ggrossetie added a commit that referenced this issue Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants