Bug, documentation or feature? Undefined method `write?'

I don’t know whether my issue should be logged as Bug, Feature Request or Documentation on the Jekyll Github issue tracker.

The issue is that I get an error “undefined method ‘write?’ for #excerpt>:Jekyll::AsciiDoc::Excerpt (NoMethodError)”. It occurs when trying to using plugins such as jekyll-mentions or jekyll-jemoji together with jekyll-asciidoc. I first logged the issue with the jekyll-asciidoc team, but they said that this is not an API method, and they therefore don’t need to support it.

The offending code is:

  def mentionable?(doc)   # or def emojiable?(doc)
    (doc.is_a?(Jekyll::Page) || doc.write?) &&   # <---- line with error
      doc.output_ext == ".html" || (doc.permalink&.end_with?("/"))
  end

My question is, should this be part of the API? If yes, is this a bug (code change needed to support it), or does it simply needed to be documented in the API documentation? If it should not already be part of the API, should I then log a feature request to get it added to the API?

Based on the comment there by Ashmaroli, it looks like doc.write? should normally work fine and the two plugins mentioned are not at fault. And that the problem is the doc object passed in is Jekyll::AsciiDoc::Excerpt which is at fault for lacking the method.

A quick fix would be just to add the method but the problem is giving it the correct behavior. What Ash said about overriding and inheritance makes me think that the Excerpt needs to inherit from Jekyll::Page or similar so then it will inherit the missing method and do the correct behavior if it is called.

Thanks, I’m waiting for a reply from the jekyll-asciidoc developers.