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

undefined method prepend when rendering table #178

Closed
gquintana opened this issue Jan 19, 2018 · 7 comments · Fixed by #179
Closed

undefined method prepend when rendering table #178

gquintana opened this issue Jan 19, 2018 · 7 comments · Fixed by #179

Comments

@gquintana
Copy link
Contributor

I get this error

C:\Work\project\src\slides\node_modules\opal-runtime\src\opal.js:4993
      throw exception;
      ^
prepend: undefined method `prepend' for "class=\"tableblock halign-left valign-top\"":String

When I build a slide deck containing a slide with a table:

= Table 

== Section 

|==== 
|Name 
|Description 

|foo 
|This is foo 

|====

My node modules are:

`-- asciidoctor-reveal.js@1.1.1
  +-- asciidoctor.js@1.5.6-preview.4
  | `-- opal-runtime@0.11.0-integration8
  |   `-- glob@6.0.4
  |     +-- inflight@1.0.6
  |     | `-- wrappy@1.0.2
  |     +-- inherits@2.0.3
  |     +-- minimatch@3.0.4
  |     | `-- brace-expansion@1.1.8
  |     |   +-- balanced-match@1.0.0
  |     |   `-- concat-map@0.0.1
  |     +-- once@1.4.0
  |     `-- path-is-absolute@1.0.1
  `-- reveal.js@3.6.0
@ggrossetie
Copy link
Member

I think it's because we are using String#prepend in templates/helpers:

attrs_str = attrs.empty? ? '' : attrs.join(' ').prepend(' ')

This method is not (yet) implemented in Opal, see opal/opal#1753
In the mean time, I think we could replace this line with the following code:

attrs_str = attrs.empty? ? '' : ' ' + attrs.join(' ')

@mojavelinux
Copy link
Member

I totally agree.

ggrossetie added a commit to ggrossetie/asciidoctor-reveal.js that referenced this issue Jan 20, 2018
…ation

`prepend` method is not implemented in Opal and will throw an expection at runtime,
when using Asciidoctor Reveal.js in a JavaScript environment.
ggrossetie added a commit to ggrossetie/asciidoctor-reveal.js that referenced this issue Jan 20, 2018
…ation

`prepend` method is not implemented in Opal and will throw an exception at runtime, when using Asciidoctor Reveal.js in a JavaScript environment.
obilodeau added a commit that referenced this issue Jan 31, 2018
Resolves #178, replace prepend method by a string concatenation
@gquintana
Copy link
Contributor Author

Great, thanks for the fix.
v1.1.2 is tagged but package is not in NPM, is it a matter of time?

@mojavelinux
Copy link
Member

I think @obilodeau said that he was unable to run the release because the build is currently failing on his machine. Once he gets that sorted out, then he'll probably notify us.

@mojavelinux
Copy link
Member

It looks like there's a change in Ruby 2.5 that's resulting in a syntax error in the generated converter code. This doesn't surprise me as Ruby 2.5 seems to have broken things in temple.

@obilodeau I recommend releasing from Ruby 2.4 for now, though obviously we'll have to sort out this syntax error if it affects users with 2.5.

@obilodeau
Copy link
Member

@gquintana version 1.1.3 was just released. Can you try it, please?

@gquintana
Copy link
Contributor Author

Perfect. Thanks @obilodeau

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.

4 participants