Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

formatting plain text code  RSS feed

 
Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'm working on a project that makes use of a JTextArea class and I'm saving text written as HTML. I would like to encorporate the ability to format plain text code just as you are doing here on this site using (code)(/code) indicators. I know I'm not showing the square brackets. I'm sure you understand why. Since someone has already created a class or method that does this kind of formatting, I didn't see any point in trying to re-invent the wheel. So, may I request a copy of the class or method responsible for formatting pain text code to HTML?

Many thanks,

Alan
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UBB (the software this forum is using) is written in Perl, not Java.
However, the logic for implementing a feature like UBB's CODE tags is very straight-forward:
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aside from being in Perl, the UBB code is a commercial product we bought; I don't believe we're at liberty to give it away to people. However you may be interested in the code developed so far for our prospective open-source replacement for UBB:

http://sourceforge.net/projects/mvnsaloon
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!