• Resolved adshap8

    (@adshap8)


    I love the plugin so far, but I’m having trouble when I create a for in loop that uses a half open range operator

    For example:

    
    let myArr = [5, 4, 8, 10, 1]
    
    for i in 1..<myArr.count {
      print (i)
    }
    

    This will get displayed on a post as:

    
    let myArr = [5, 4, 8, 10, 1]
    
    for i in 1..
    

    Not sure what is causing this to get cut off. Any help would be much appreciated! Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Not sure what might be happening, but if you have a URL, I would be glad to take a look.

    Thread Starter adshap8

    (@adshap8)

    Thanks Jeff for getting back to me.

    Check out this test page here.

    For reference, the post is composed as follows:
    —–

    Testing out code…

    let myArr = [5, 4, 8, 10, 1]
    
    for i in 1..<myArr.count {
      print (i)
    }

    Test 2

    //Second set of additional code
    for i in 1...5 {
      print (i)
    }

    The only time I’ve seen this strange breaking behavior is when using ..<

    Plugin Author Jeff Starr

    (@specialk)

    Hi @adshap8, thanks for reporting. It looks like a bug with Prism.js not escaping code in that instance. The best thing to do is report the issue with Prism.js devs:

    https://github.com/PrismJS/prism/issues

    So they can try to replicate and resolve. The plugin itself only loads the Prism.js scripts and styles, and does not add JavaScript or highlighting features of its own, just fyi.

    Thread Starter adshap8

    (@adshap8)

    Ahh okay, got it. Thanks for pointing me in the right direction!

    Plugin Author Jeff Starr

    (@specialk)

    Anytime, @adshap8. And thank you kindly for the great review!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Code snippet get cuts off when use ..< in a for in loop’ is closed to new replies.