SPAN tag doesn't display properly in JTextPane

  • Thread starter Henry S. Thompson
  • Start date
H

Henry S. Thompson

Loading HTML into a JTextPane (1.4.2) w. an HTMLEditorKit works well,
except the SPAN tag doesn't seem to be supported properly -- it
renders as a space for start and end tag, and ignores class-based
style info, i.e.

<html>
<head>
<style type='text/css'>
.special {font-weight: bold}
</style>
</head>
<body>
<p>This
illustrates <span class='special'>|</span>the<span class='special>|</span>
problem.</p>
</body>
</html>

Appears like this:

This illustrates | the | problem.

I note that although SPAN is listed as an HTML.Tag, it's _not_ listed
in the table of actions for HTMLDocument.HTMLReader.

Is this a bug or a feature, and is there a well-known workaround?

Sorry if this is an FAQ, I googled pretty hard without finding
anything.

Thanks

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top