Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Error when posting an issue with fenced code blocks #272

Closed
vitorgalvao opened this issue Jan 28, 2016 · 4 comments
Closed

Error when posting an issue with fenced code blocks #272

vitorgalvao opened this issue Jan 28, 2016 · 4 comments
Assignees

Comments

@vitorgalvao
Copy link

When opening an issue with a message that has code in backticks, ghi behaves just as expected

ghi open --message "Issue title

Issue body with \`some code\`.

End example."
#7: Issue title
@vitorgalvao opened this issue 0 seconds ago.   open

    Issue body with  some code .

    End example.


Opened on vitorgalvao/tmp.

However, if the message has a fenced code block, it errors out.

$ ghi open --message "Issue title

Issue body with \`some code\`.

\`\`\`
And here we have
a fenced code block
\`\`\`

End example."
/Users/vitor/.rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- pygments (LoadError)
    from /Users/vitor/.rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/bin/ghi:1794:in `highlighter'
    from /usr/local/bin/ghi:1526:in `highlight'
    from /usr/local/bin/ghi:2313:in `block in format_markdown'
    from /usr/local/bin/ghi:2312:in `gsub!'
    from /usr/local/bin/ghi:2312:in `format_markdown'
    from /usr/local/bin/ghi:1948:in `indent'
    from (erb):10:in `format_issue'
    from /Users/vitor/.rubies/ruby-2.3.0/lib/ruby/2.3.0/erb.rb:864:in `eval'
    from /Users/vitor/.rubies/ruby-2.3.0/lib/ruby/2.3.0/erb.rb:864:in `result'
    from /usr/local/bin/ghi:2058:in `format_issue'
    from /usr/local/bin/ghi:4171:in `execute'
    from /usr/local/bin/ghi:2762:in `execute'
    from /usr/local/bin/ghi:91:in `execute'
    from /usr/local/bin/ghi:4285:in `<main>'

Now, it is important to note that ghi succeeds in opening the issue correctly, everything works correctly there. It is just the displaying to the CLI part that gets screwed.

Not even sure this is as issue for you. Is ghi the culprit, or pygments?

@AlexChesters
Copy link
Contributor

Interesting, but this looks like a possible duplicate of #221. Can you run gem install pygments? What happens when you do?

@vitorgalvao
Copy link
Author

Can you run gem install pygments? What happens when you do?

Oh, right, I had done so but forgot to post the output.

$ gem install pygments
ERROR:  Could not find a valid gem 'pygments' (>= 0) in any repository
ERROR:  Possible alternatives: pigments, rygments, segments, pigment, rb-pygments

However, by looking at #221, I saw that the correct command was gem install pygments.rb. That worked, and solved the issue.

Shouldn’t this still be considered a bug, though? ghi should install pygments.rb if not installed, or at least warn about it instead of spewing the error message. I’ve installed ghi from the homebrew formula, if that makes a difference.

Any more details I can give?

@AlexChesters
Copy link
Contributor

I'd agree with that @vitorgalvao, sounds like pygments should be added to the gemspec file as a dependency. @stephencelis do you agree?

@AlexChesters
Copy link
Contributor

pygments.rb is now a dependency, this landed in 1.1.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants