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

Crash on github-compatible markdown #1

Closed
particleflux opened this issue Aug 26, 2015 · 2 comments
Closed

Crash on github-compatible markdown #1

particleflux opened this issue Aug 26, 2015 · 2 comments

Comments

@particleflux
Copy link

Trying to run mdless on github-compatible markdown, for example the yii2 README crashes almpost instantly:

$ mdless tmp/README.md 
Yii 2 Advanced Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for
developing complex Web applications with multiple tiers.
/usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:421:in `*': negative argument (ArgumentError)
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:421:in `block (2 levels) in convert_markdown'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:417:in `map'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:417:in `block in convert_markdown'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:397:in `gsub!'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:397:in `convert_markdown'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:120:in `block in initialize'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:108:in `each'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:108:in `initialize'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/bin/mdless:17:in `new'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/bin/mdless:17:in `<top (required)>'
    from /usr/local/bin/mdless:23:in `load'
    from /usr/local/bin/mdless:23:in `<main>'

EDIT: revelant env is:

COLUMNS=92
LANG=en_US.utf8
LESS='-R -M --shift 5'
LESSOPEN='|lesspipe %s'
LINES=31
PAGER=/usr/bin/less
SHELL=/bin/bash
TERM=rxvt-unicode-256color
@i-tu
Copy link

i-tu commented Oct 4, 2015

I had this same error and narrowed it down to the following circumstance:

A line in a code block is longer than 80 characters, and Pygments is not installed.

@rfdonnelly
Copy link
Contributor

Fixed in PR #5

ttscoff added a commit that referenced this issue Mar 25, 2019
…nnelly/mdless into rfdonnelly-fix-negative-argument-error

* 'fix-negative-argument-error' of https://github.com/rfdonnelly/mdless:
  fix #1 - crash on github-compatible markdown

Signed-off-by: Brett Terpstra <me@brettterpstra.com>

# Conflicts:
#	lib/mdless/converter.rb
ttscoff added a commit that referenced this issue Mar 25, 2019
* rfdonnelly-fix-negative-argument-error:
  fix #1 - crash on github-compatible markdown
ttscoff added a commit that referenced this issue Mar 25, 2019
* release/0.0.11:
  version bump
  Remove has_rdoc from Gemspec
  Making STDIN work for not-ready IO data (ie. block)
  fix code blocks without language tag
  only use the first word after '```/~~~' as language name
  Added ability to parse shebang, as allowed in BitBucket README files
  fix #1 - crash on github-compatible markdown
ttscoff added a commit that referenced this issue May 20, 2019
* 'develop' of github.com:ttscoff/mdless:
  Code blocks with more than 253 characters raise an error
  Error raised when git is not installed
  version bump
  Remove has_rdoc from Gemspec
  Making STDIN work for not-ready IO data (ie. block)
  fix code blocks without language tag
  only use the first word after '```/~~~' as language name
  Added ability to parse shebang, as allowed in BitBucket README files
  fix #1 - crash on github-compatible markdown

Signed-off-by: Brett Terpstra <me@brettterpstra.com>

# Conflicts:
#	lib/mdless/converter.rb
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

No branches or pull requests

3 participants