Ask Your Question
0

Edit HTML in Writer: <DIV> & CSS are removed. [closed]

asked 2013-03-28 13:11:25 +0200

shiyuan gravatar image

updated 2015-10-27 23:42:02 +0200

Alex Kemp gravatar image

I use Writer to edit large quantity of HTML files, very simple tasks with find and replace (regx) to words and punctuation. The Writer version is LibreOffice 3.5.4.2 on Mac os X 10.6.8.

Here is a minimum example:

  <head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Title</title>
 <style type="text/css">
.poem {
    margin-left:10%;
    margin-right:10%;
    text-align: left;
}

.poem .stanza {margin: 1em 0em 1em 0em;}

.poem span.i0 {
    display: block;
    margin-left: 0em;
    padding-left: 3em;
    text-indent: -3em;
}

.poem span.i2 {
    display: block;
    margin-left: 2em;
    padding-left: 3em;
    text-indent: -3em;
}
    </style>

</head>
<body>

<h1>Chapter One</h1>

<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

<div class="poem"><div class="stanza">
<span class="i0">"I pass'd without the city gate,<br /></span>
<span class="i2">I linger'd by the way;<br /></span>
<span class="i0">The palm was bending to her mate,<br /></span>
<span class="i2">And thus I heard her say,<br /></span>
</div></div>

<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

</body>
</html>

However, One I edited and saved it, i.e. editing the punctuation in the Poem DIV section. the DIV and CSS is removed by the writer as the following code shows. Is there is a way to ensure the integrity of the code?

<P ALIGN=LEFT>“I pass’d without the city gate,<BR ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-10-27 23:42:28.574379

1 Answer

Sort by » oldest newest most voted
0

answered 2013-04-01 18:03:03 +0200

mahfiaz gravatar image

Writer is not right tool for that. Just use any decent plain text editor.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-28 13:11:25 +0200

Seen: 1,912 times

Last updated: Apr 01 '13