• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

formatting plain text code

 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic