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

FrozenError when processing backticks in tables #571

Closed
mvz opened this issue Jan 23, 2019 · 6 comments
Closed

FrozenError when processing backticks in tables #571

mvz opened this issue Jan 23, 2019 · 6 comments
Assignees
Labels

Comments

@mvz
Copy link

@mvz mvz commented Jan 23, 2019

With kramdown 2.0, I get a FrozenError when processing tables that have backticks in them. The following demonstrates this error:

require 'kramdown'

string = <<END

Foo   | Bar | Baz
------|-----|------
`foo` | bar | baz

END

Kramdown::Document.new(string)

Running this code raises a FrozenError:

Traceback (most recent call last):
	15: from foo.rb:11:in `<main>'
	14: from foo.rb:11:in `new'
	13: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/document.rb:102:in `initialize'
	12: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/base.rb:69:in `parse'
	11: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown.rb:88:in `parse'
	10: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown.rb:143:in `parse_blocks'
	 9: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown.rb:143:in `catch'
	 8: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown.rb:145:in `block in parse_blocks'
	 7: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown.rb:145:in `any?'
	 6: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown.rb:147:in `block (2 levels) in parse_blocks'
	 5: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown/table.rb:69:in `parse_table'
	 4: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown/table.rb:69:in `each_with_index'
	 3: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown/table.rb:69:in `each'
	 2: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown/table.rb:77:in `block in parse_table'
	 1: from /home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown/table.rb:77:in `each'
/home/matijs/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/kramdown-2.0.0/lib/kramdown/parser/kramdown/table.rb:80:in `block (2 levels) in parse_table': can't modify frozen String (FrozenError)
@gettalong gettalong self-assigned this Jan 23, 2019
@gettalong gettalong added the bug label Jan 23, 2019
@gettalong
Copy link
Owner

@gettalong gettalong commented Jan 23, 2019

Thanks for reporting - I have fixed this with the latest commit.

@gettalong gettalong closed this Jan 23, 2019
@tammersaleh
Copy link

@tammersaleh tammersaleh commented Jan 27, 2019

Any chance you could drop a quick 2.0.1 to include this?

@gettalong
Copy link
Owner

@gettalong gettalong commented Jan 29, 2019

@tammersaleh If you mean by quick, some time in the next 7 days, yes, probably.

@gettalong
Copy link
Owner

@gettalong gettalong commented Jan 31, 2019

@mvz @tammersaleh New version with the fix is available.

@tammersaleh
Copy link

@tammersaleh tammersaleh commented Jan 31, 2019

@gettalong perfect! Thank you!

@mvz
Copy link
Author

@mvz mvz commented Jan 31, 2019

Thanks, @gettalong!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants