Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Hazar Askari 12 posts 73 karma points
    Aug 18, 2015 @ 10:01
    Hazar Askari
    0

    Pasting and formatting html code in the richtext editor

    Hello guys,

    Im trying to make a "Library" for our small group of developers at the office. We find ourselves looking up the same code and logic everytime we do a project. So it hit me, why not build a library where we put all the most common problems/solutions that we face each project? An example is to add code for smooth scrolling, or another example would be to add the code we use to add Parallax scrolling to elements on the page.

    So here is my question/problem. How do i paste code into the RichText Editor, and get it to add the indents and proper formatting to the code? Whenever i paste code from Visual Studio to RichText Editor it looks like this (Image below). enter image description here

    So as you see, the formatting/indenting from Visual Studios is removed. So what i tried was to paste the code from Visual Studios to Word, and then from word to RichText Editor, that seemed to keep the formatting, BUT it removes spaces sometims, which ruines the code. An example for what goes wrong here is it removes the space between a div and the class attribute so it would looks like this

    what can i do? how do other people do it? I see our.umbraco.org has nailed it on their code documentation examples. how have they done it? how do you keep the code formatting as it is when you paste it into the richtext editor?

    here is an example of the code from our.umbraco.org: enter image description here

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Aug 18, 2015 @ 10:07
    Dennis Aaen
    0

    Hi Hazar,

    I was thinking when you say library if you have see the package called Bookshelf from Kevin Giszewski

    https://our.umbraco.org/projects/backoffice-extensions/bookshelf/

    Perhaps this could solve the functions that you are looking for, to share documentation in your office.

    Hope this helps,

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft