HTML import corrupting tags
Levi Kendall
ljk144 at gmail.com
Mon Jun 13 15:38:16 EDT 2005
Hi all,
I am trying to import html into a text field but there are tags
which are modified during the import. This causes the field to
"roughly" represent the html but it's not truely representing what the
html is supposed to be. When the text is then exported back to an
html file the end result does not match the data that was imported.
What I am looking for is if there is a way to stay more true to what
the original html data was between import, editing, and export.
My basic experiment html file looks as such:
<html><body>
Demo Html File
<blockquote>blockquote text</blockquote>
<table border=2>
<tr>
<td>cell 1 text</td>
<td>cell 2 text</td>
</tr>
</table>
</body></html>
Fairly basic, not too many things going on here, just a blockquote and
a table. There are two different results I can get. The first result
comes from just copying this when it is displayed in a browser and
pasting it into the field. This results in the following in terms of
htmltext of the field:
<p>Demo Html File</p>
<p></p>
<p> blockquote text</p>
<p></p>
<p>cell 1 text cell 2 text </p>
This is "close" but not completely the same. The second way I am
importing the file is to use set with the URL keyword, the commands
would look like:
answer file "Import HTML" filter with "HTML File,*.HTM,*.HTML"
set the htmltext of field "Demofield" to URL ("file:" & tFilename)
This results in the following exported data:
<p>Demo Html File</p>
<p></p>
<p>blockquote text</p>
<p></p>
<p> cell 1 text cell 2 text
</p>
So with the file just being imported and exported the blockquote is
not indented this time and the cells are separated (and indented now?)
by spaces instead of a tab character.
Is there any way to stay more true to what the HTML is during the
process? Thanks.
-Levi
More information about the use-livecode
mailing list