icyleaf / markd

Yet another markdown parser, Compliant to CommonMark specification, written in Crystal.
MIT License
109 stars 30 forks source link

Error: no overload matches 'String#*' with type (Float64 | Int32) #23

Closed drujensen closed 4 years ago

drujensen commented 4 years ago

getting a compilation error using Markd.to_html(markdown)

In lib/markd/src/markd/parsers/inline.cr:460:26

 460 | "\u{2014}" * em_count + "\u{2013}" * en_count
                  ^
Error: no overload matches 'String#*' with type (Float64 | Int32)

Overloads are:
 - String#*(times : Int)
Couldn't find overloads for these types:
 - String#*(times : Float64)

shards.yml

  markd:
    github: icyleaf/markd
    version: 0.1.2

If I change to "\u{2014}" * em_count.to_i + "\u{2013}" * en_count.to_i then it compiles and seems to work.

elorest commented 4 years ago

I fixed this on my branch and then noticed it's already been fixed on master.

In Crystal 0.31 3/2 => 1.5

I don't see that in the breaking change list...

Apparently 3//2 => 1 though.

https://github.com/crystal-lang/crystal/pull/8120

elorest commented 4 years ago

@icyleaf Is master stable enough to be released as 0.2.0?

icyleaf commented 4 years ago

I'm on vacation now, you can use master branch.

icyleaf commented 4 years ago

Close for no response, feel free to file new issue or reopen.

drujensen commented 4 years ago

@icyleaf Thanks for releasing a fix.