Unit content editor changes text automatically

Home Forums Legacy Support Support queries Other issues Unit content editor changes text automatically

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #69928
    pacworks
    Spectator
    When adding text to a unit using the content editor in TEXT mode, not VISUAL, it automatically rearranges my content. I am using divs to style content within the text. I can arrange the text how I want, in an organized way, but upon saving, it removes all spaces and somehow rearranges or deletes some of my divs. Is there a setting or some code I can modify so the content editor leaves my text/code exactly as I input it?  
    #69956
    H.K. Latiyan
    Participant
    The space added in the text mode won't work as the html do not recognise the space, html uses " " for spacing. So either use it for spacing or just add the divs you want and do all the spacing work in visual mode, it will automatically add spaces.    
    #70236
    pacworks
    Spectator
    Thank you for your reply. I feel like I may not have explained my situation well. I realize spaces in html need to be coded in using "&nbsp;". I'm specifically just talking about the way text appears in the editor after saving. Here is an example of what is happening. If I input organized code like like this into the text editor: <div class="container"> <div class="sample"> <div class="sample-2">Sample 2</div> </div> <div class="some-text"> Several paragraphs of text. </div> </div> After saving, my code is changed to something like this: <div class="container"><div class="sample"><div class="sample-2">Sample 2</div> </div><div class="some-text">Several paragraphs of text.</div></div> Its almost as if the editor is minimizing my code, but in the process it seems to try and calculate whether or not all of  my divs are needed. I kept having this problem where the editor kept deleting an opening and closing container div (leaving all the content in the middle). I couldn't figure out why my content wasn't outputting correctly until I realized that code I had inputted disappeared after saving. I finally got it to save and keep my changes, but it was annoying. I don't so much mind that the editor scrunches all of my code together, although it makes it more difficult to make edits if needed, but removing code is not cool. I wasn't sure if this was a setting or if it was something I could change easily, but I would like the text editor to leave my text exactly how I input it.
    #70241
    pacworks
    Spectator
    Apparently the same thing happens with the text editor in this forum. I entered the text like this in visual mode: screenshot 01 After clicking "Reply" it removed spaces and posted like this: <div class="container"> <div class="sample"> <div class="sample-2">Sample 2</div> </div> <div class="some-text"> Several paragraphs of text. </div> </div> I added "&nbsp;" to see if I could code in the spaces in text mode and switched to visual mode. The spaces were there, but when I switched back to text mode, the "&nbsp;" code I had inputted was removed.  
    #70351
    Anshuman Sahu
    Keymaster
    Okay thanks for the explanation . YEs sometimes the tinymce editor trims the special chars . It trims white spaces and unclosed divisions in the html dom and hence the html remains like this .
    #70405
    pacworks
    Spectator
    Okay. I can deal with it trimming white spaces. Is there anyway to make the editor not change my actual code? For instance, I was working with it today trying to cope with it. I have a folder titled "img" in my root directory. So, when I try to link to an image in that folder I am typing the link like this: /img/biology/intro_1.jpg   Upon saving, the editor changes it to this: ../img/biology/intro_1.jpg   "/" and "../" are not the same thing. "/" directs to the root folder. "../" directs to move up one folder. So, I can't get my images linked properly because the editor changes this, resulting in broken images. I also noticed that if I make changes in text mode and then click save, it reverts back to the last save point and then saves, which totally eliminates my changes. For instance, if I am in text mode and I completely delete all of the text, and then click save. It puts all of the text back in the editor and then saves it. However, if I am in text mode and delete all of the text and switch to visual mode, then save, it keeps my changes (mostly, it still changes some of my codes, like the links mentioned above). I don't know why it is doing this, but it is making it very difficult to work with.
    #70493
    Anshuman Sahu
    Keymaster
    Well you need to provide the absolute urls there in the wp-editor to provide the links to the images ../  folder roots wll not work and will be trimmed off . You can use the third party plugins like this if you want to use the Raw html in wordpress pages .
    #70534
    pacworks
    Spectator
    Thank you! The recommended plugin makes the editor function exactly how I want. I didn't realize until just now that this was more of an issue I had with WordPress rather than WPLMS, but thank you for offering a solution.
    #70541
    pacworks
    Spectator
    Maybe I spoke too soon. The plugin appears to be working perfect for posts and pages, but doesn't seem to be affecting unit posts within the LMS. At least, the same options are not available in the right column as with posts and pages. Do you know of a way to extend this plugin to the unit posts?
    #70669
    Anshuman Sahu
    Keymaster
    Ok i have modified the plugin to work with the units also .You can download the modified version here : http://www.filedropper.com/raw-html_1
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Unit content editor changes text automatically’ is closed to new replies.