leading space/indentation when pasting text in the visual editor
-
In the near future we want to post source code snippets in our blog, such as pieces of XML, SQL statements, or small pieces of Java code. Usually I already have such samples in plain text files (Notepad). However, when I copy and paste any kind of text from Notepad into the visual blog editor, all leading spaces are gone. So, regardless of the original indentation, all lines start at position 1. I did not find any other solution then to manually restore the desired indentation, which is very tedious.
I did search the forum for a while but didn’t find any good solutions yet.
Any suggestions?
Thanks!
The blog I need help with is: (visible only to logged in users)
-
@ matthiasnicola
First suggestion would be to give us a link to the blog you are asking about. We can’t help if we can’t see!
http:// WHO-ARE_YOU???
-
Oh, sorry about that. Our blog is http://nativexmldatabase.com/
You won’t see the problem in any of our recent blog posts. The reason is that we have not yet published any postings when leading spaces of pasted text were removed.
Interestingly, when I paste text with leading spaces into this field here for the forum post, the leading space are preserved. Example:
test with 0 leading spaces
test with 3 leading spaces
test with 6 leading spaces
test with 9 leading spacesWell, let see whether these spaces above still show up after I click on “submit”.
When I paste the same 4 lines into the visual editor for our blog, the leading spaces are immediately gone. Thanks.
-
Ok, the leading spaces that were preserved in the edit box (after pasting the 4 test lines) did get removed *after* I clicked submit. In the visual editor they get removed immediately on paste.
-
Interestingly, this problem with the leading spaces does not happen in my IE 6.0 browser. Previously I was using Firefox 2.0, which is where I had the problem. I’ll continue testing and will post my findings here.
-
Sorry to have taken so long to get back here. (work, don’t cha know!)
This, from a fellow forum volunteer, looks like the information you need:
-
-
-
-
@1tess: thanks for the link to the instructions for doing indentations in HTML! I’m sure that will come in handy. I tried various things by creating mock blog posts and then looking at the preview. When I use IE 6.0, I can paste text with leading spaces into the Visual Editor and these spaces are preserved, in the editor and in the preview. This is ideal for my needs. So, I think that’ll work well for me for now.
Thanks for your responses. Much appreciated.
-
You can check how your site looks in various browsers by putting this into the Google search bar: “test my site in multiple browsers”
http://www.google.com/search?client=safari&rls=en&q=test+my+site+in+multiple+browsers&ie=UTF-8&oe=UTF-8
Choose one, and check it out.If you are on IE 6.0, then you are forgetting quite a few potential readers if your spacing is meaningful / critical for your posts.
Lots of folk use other browsers, browser versions, screen resolutions and so on.
- The topic ‘leading space/indentation when pasting text in the visual editor’ is closed to new replies.