Writer adding HTML elements i don't want, stripping stuff I do want

I am using Libre Office on a Live CD for a Linux distro, it is Libre Office Version In this case it doesn’t even have separate Writer & sWriter components, it just handles it as Writer/Web in the Live Disk version. But I think I and many others would like to know how to stop this annoying behavior for HTML documents.

When you save an HTML document with writer, it saves it with all this (for my purposes) useless data that I don’t want in there - I want a clean HTML document, that I will do my own formatting of. I tried to save it as a plain text document with the HTML file extension, didn’t work.

The stuff I am talking about is in the header section of the document, meta-data I would guess you would call it, and it automatically puts in formatting for body, and automatically puts everything in as a paragraph. I do not want that in my HTML document. I have a little ‘template’ that I will paste in as my source for the HTML document. I will put in my own paragraph tags, DIV tags, and any other tags I want in there.

It also deletes out code that is vital for what I am wanting to do. There is no good outlining software for Linux (single pane, expandable/collapseable elements, etc.) and none like this that I can find for Windows either. I don’t want to use mind mapping software or a text editor with code folding or anything like that as a substitute. Writer lets you outline, but it doesn’t hide the text (I know you can hide the text, by making a field or some such rubbish and then jumping through 10’s of flaming hoops and such, and then when you’re done you can only hide/unhide that text all at once) so when you are doing a long outline — Writer becomes totally unusable for this. You can end up with an outline in Writer that is like 50 pages long because all text is exposed at all times in Writer, and it can be done in just a couple/few pages in another Word Processor that shall remain nameless (I’m 50 years old and don’t have the time to listen to all the childish m$ rubbish, flame wars, etc) – because you can collapse/expand the text blocks, headers, etc in that WP.

There is a ‘bug’ discussion about adding proper outlining for both OOo (did I get that right? the Open Office suite) but it’s like 20 years old - and the most commented on & reported bug/feature request of all of them at the Open Office bug reporting site. And there was a short ‘bug’ discussion about adding proper outlining to Writer in the Libre Office bug reporting site or the Wiki, but it is fairly old too, and didn’t get many comments. So, one can deduce from this that the coders are never going to get around to it – or they would have 20 years ago, as the aforementioned Word Processor that shall remain nameless has had it since it’s earliest days - since writers consider it so vital to the writing process that this is a make/break matter for them, and the writers of this other to remain unnamed Word Processor want the customers/users, not to tell the users what they do/don’t need. Read the bug reports/wiki post if you are interested in why it is so important to writers.

So, I had a kinda sorta workaround for this. With a lot of research on the Internet, I found JavaScript code and some HTML code that can be used to hide/unhide text in an HTML document. Yes, without CSS sheets attached (although this might make it easier, do it once and it’s done), with just a little block of JavaScript and using some HTML coding!

Works FABULOUSLY when you do it in a text editor. Somehow, Writer breaks the functionality and it won’t work at all when done using Writer HTML format (why did Writer NEED it’s own HTML format anyway? hmm). I would have to test it again, but I think writer html format actually strips this code out of the HTML document before saving it.

If you put the following code into a clean plain HTML document, you can hide/unhide text with a mouse click, yes that’s right one single mouse click!

JavaScript code :

<script type="text/javascript">

function toggleShowHide(elementId) {
var element = document.getElementById(elementId);
if (element) {
if (element.style.display == “none”)
element.style.display = “inline”;
element.style.display = “none”;

It didn’t render the JavaScript code right, I can send it to someone who knows how to put it into a post and get it to work if they would like.

HTML code for the parent element, like say “Chapter 1”

<p onClick="toggleShowHide('hiddenText') "color:#000033">+ What will we discuss today? (Click me.)</p>

HTML code for hidden text, say a DIV :

<div id="hiddenText" style="display:none">The trick to include a drop down text in your web page.</div>

So, what I need to do is this.

  1. Stop Writer from putting in that code that I do not want in my HTML document
  2. Stop Writer from stripping out MY code when I enter it.
  3. Stop Writer from doing these things every time I save/edit the HTML document

Is this possible? If so, how?

Thank you

I assume that you want to create HTML documents. I have found in testing that LO does not produce particularly good HTML. It works in that the HTML renders what you designed but has a poor HTML format.

I think you have to be aware that Writer is primarily a Word Processor and if you want to produce HTML you should be using a program designed for producing Web pages.

Thanks Peter, I had noticed this. Unfortunately, I don’t have a webpage composer on this Linux Live CD, and I don’t know how to add one. I have done google searches on redoing a Live CD to add programs, but it seems to be a process that is quite advanced and complicated, beyond my capabilities. I just wish there was some way to get Writer/sWeb from adding this junk, just giving you a nice clean webpage without all their ‘meta’ mess.

LibO uses the fully documented international Open Document Standards,@(ODF, .odt, .ods etc), not it’s own arbitrary proprietary standards. You do not say what it is you are trying to do, so I am unable to suggest alternatives as LibO does not appear to be the optimum choice for your application.

LibO HTML support is well documented in the HELP section of LibO, (F1 and use the index). This would reduce your uncertainty as to the support provided. Again, these are international, not arbitrary LibO standards, and its basis it to allow interchange of documents between systems.

Sorry this does not appear to be the answer you desire…Peter

Thanks petermau, actually I did explain what I want/need to do. I need a clean webpage, where I add MY markup, without all the writer ‘meta’ mess. Then, I need it to stop changing the document every time I save it, putting all that junk back in there. I find it hard to believe that the international standard would call for things like , with all of the attention starting to be paid to user privacy on the internet.

That kind of information does NOT need to be shared with the whole world, some poor schmuck in China accidentally gets his name stuck in a web doc and someone is going to be paying him a visit to ask him questions and none of them will have anything to do with “So, Mr Lee, would you like to enter our geekiest geek contest?” LO needs to concentrate on a clean HTML source in the document without all this added UNNECESSARY meta info, automatically adding in paragraphs, formatting info, etc