Restricted markup editor for textarea

P

peter

I'm looking for a Javascript editor similar to the obsolete HTMLarea
editor but which can be configured to restrict the buttons and
allowable markup to a tiny handful of named elements on a per-instance
basis. No font selection, or any other WYSIWYG bells or whistles. The
objective is to *prevent* the user from adding any markup except that
which is specified,

It's for a translation editor, where each source paragraph will only
ever contain a subset of other possibilities (elements like
<citetitle>, <xref>, <emph>, etc), but the selection will change from
para to para and may contain nested markup. The page is being
generated dynamically from XML using Cocoon, so each textarea can
easily be separately configured on-the-fly.

In effect I want an HTMLarea equivalent but stripped of all WYSIWYG
gunk except the named elements needed in each instance, plus their
button labels and their rendering (as CSS). My JS isn't good enough to
strip down HTMLarea to do the job.
 
J

jamie.ly

I'm looking for a Javascript editor similar to the obsolete HTMLarea
editor but which can be configured to restrict the buttons and
allowable markup to a tiny handful of named elements on a per-instance
basis. No font selection, or any other WYSIWYG bells or whistles. The
objective is to *prevent* the user from adding any markup except that
which is specified,

editors (not sure if you can restrict markup)
http://www.fckeditor.net/
tinymce

to build your own try javascript regular expressions:
html = html.replace (/\</?font[^\>]\>/, g) for example will strip all
font tags from the document
html = html.replace (/\</?(font|span|b|u|strike|strong|underline|div|
pre|blockquote)[^\>]\>/, g) will strip all the tags listed font, span,
b, u, strike....
 
P

Peter Flynn

editors (not sure if you can restrict markup)
http://www.fckeditor.net/
tinymce

Thanks...but it doesn't look as if restricting stuff is an option there.
to build your own try javascript regular expressions:
[snip]

The replacement isn't the problem...it's writing the typographical edit
window I wanted to avoid.

But I made some good progress with HTMLarea today, stripping it down to
the bare bones and then adding in only the bits I want.

Thanks for the suggestions.

///Peter
 

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,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top