pragdave / earmark

Markdown parser for Elixir
Other
859 stars 135 forks source link

Negative steps are deprecated #463

Closed robkane1 closed 1 year ago

robkane1 commented 1 year ago

Elixir: 1.16 earmark/parser: 1.4.32

Elixir has deprecated negative steps on slice operations. Something it seems Earmark uses liberally. https://github.com/elixir-lang/elixir/commit/d7c6edbe7834ac3da30c4e169ca214e8cbb234bf

My console is a sea of warnings every time I use Earmark. Eg negative steps are not supported in String.slice/2, pass 11..-1//1 instead

One for the backlog. :)

RobertDober commented 1 year ago

1.16 OMG, thanx for the info, backlog as you said

robkane1 commented 1 year ago

I can see that this was fixed here: https://github.com/RobertDober/earmark_parser/commit/9bbf43c8b6c9868129be036916a95441ee8b0179

Thank you! I landed on the alternative solution locally because my console was a mess. 'String.slice(str, ignore..-1//1)' I noticed the comment about this only working on 1.12 afterwards, but it seems fine on 1.16. That said - I think I trust Jose Valim's knowledge of edge cases more than I trust myself on this one :D

Thought I would just put an update here in case anyone else was looking for a tactical fix or a timeline. I won't close it in case you want to track it for release.

Edit: I just re-read the comment and realised it requires at least 1.12. I clearly haven't had enough coffee yet!

RobertDober commented 1 year ago

My appologies I have a strange local behavior on my old machine but as the CI tests pass I should probably release now. BTW there that it is ok for Elixir 1.11 (as code coverage is 100% and this function call is ubiquitous anyway I shall release tomorrow, because EarmarkParser was released on July 4th, would be fitting to release Earmark on July 14th ;)

RobertDober commented 1 year ago

released 1.4.39 as promised ;)