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

Forum statistics

Threads
474,001
Messages
2,570,249
Members
46,846
Latest member
BettinaOsw

Latest Threads

Top