Inkscape.org
Forum Issues, News, and Announcements Code wrapping doesn't work
  1. #1
    Chameleon Scales Chameleon Scales @Chameleon_Scales
    *

    When I try to format a text block as code by clicking on the "Wrap Code" button, it doesn't work.

    Even worse, if the text is multiline, the button removes all the line breaks in my selection so I end up with a single line.

  2. #2
    Patrick Storz Patrick Storz @Ede_123

    You need to use the "Formatted" text style from the dropdown:

    Here
       is
    some
       code

    I never understood what the "Wrap code" button was supposed to do tbh. @doctormo explained it at one point, but I didn't get it.

  3. #3
    Martin Owens Martin Owens @doctormo🌹🧀

    Not sure I understand it all to be honest, it's about looking at what's available from the editor javascript library and trying to put it into a sensible set of options.

    Anyone should be able to do this since it's not a coding task.

  4. #4
    Patrick Storz Patrick Storz @Ede_123
    *

    Then this should be code!

     

    Edit: No luck. I guess it's this: https://ckeditor.com/cke4/addon/codeTag ?

    It *should* do what we want, i.e. wrap code as <code>some text</code>, but it does not seem to work.

  5. #5
    Tyler Durden Tyler Durden @TylerDurden

    Wrap code is how to embed.

    See this comment: https://inkscape.org/forums/forum-news/is-there-a-way-to-get-out-of-wysiwyg-posting/#c3202

  6. #6
    Patrick Storz Patrick Storz @Ede_123
    *

    I don't get it, sorry. I'm having a hard time to understand what this *should* be doing, let alone finding a valid use case for it.

    • test 1
    • test 2

    Especially: What code does it allow to wrap? Any code? Does it allow execution of random scripts? I'm a bit afraid right now... If we want a source mode, we should add a source mode to ckeditor, not have some mysterious function that might or might not convert HTML to something else..

  7. #7
    Tyler Durden Tyler Durden @TylerDurden

    Wrap seems to be broken today. I embedded some images inline just yesterday:

    https://inkscape.org/forums/questions/cutting-paths/#c4908

     

    :?

     

    TD

  8. #8
    Patrick Storz Patrick Storz @Ede_123
    *

    Well, it does work. I was able to embed an image with the code you linked, and I produced the <ul> above with it, but honestly this seems useless at best and dangerous otherwise.

  9. #9
    Tyler Durden Tyler Durden @TylerDurden

    Typo in my string. My bad.

    I would prefer an easier way to insert images inline for presenting step-by step methods, but until we have a buttom for that, I'll use wrap code.

     

    TD

  10. #10
    Patrick Storz Patrick Storz @Ede_123
    *

    "Pro tip": You can copy+paste images into posts. 😉

    It's not oficially supported as per our webmaster, though, but it certainly feels right. 😇

     

     

  11. #11
    Martin Owens Martin Owens @doctormo🌹🧀

    I was sure that there wasn't an embed (for javascript), but if you find one, let me know and we can remove it.

  12. #12
    Patrick Storz Patrick Storz @Ede_123

    @doctormo Well, it certainly seems possible:

    Click me!

  13. #13
    Chameleon Scales Chameleon Scales @Chameleon_Scales
    *

    Thank you all.
    I noticed a bug with code formatting, which you can see in this other topic: https://inkscape.org/forums/forum-news/no-line-wrapping