[whatwg] Textarea Wishlist

James Graham jg307 at cam.ac.uk
Wed Jun 30 15:47:50 PDT 2004

Ian Hickson wrote:
> On Wed, 30 Jun 2004, Ryan Johnson wrote:
>>3) Extensible syntax highlighting (coloring). I am aware that a ton of
>>code editors don't even do this well. The ability to load a syntax
>>definition file and have it color a block of code would do wonders for
>>making the web a more friendly place to script.
> This is hard. ;-) Would be nice though. Noted for Web Apps.

I was having thoughts about a somewhat similar feature - the ability to 
specify a input 'language' for a text-area and possibly to specify a 
subset of language elements allowed. This would principally be for 
situations in which the input was text supplemented by a markup language 
such as (x)html, textile, bbcode or similar. Providing this information 
would allow the UA to provide word-processor-like editing controls for 
the textarea. Allowing the specification of a particular subset of the 
language (e.g. html, 'a' elements only, 'href' and 'lang' attributes 
only) would allow the UI to be further refined. Clearly one would need a 
set of default language profiles to ship with the UA. A good 
implementation might allow the set of profiles to be easily extended. 
There would need to be a mechanism for storing and fetching the 
information about the allowed subset of the language.

 From the point of view of the textarea, this would require two new 
attributes -  inputformat and inputprofile where inputformat is a 
string/uri identifying the language being  used and inputprofile is a 
URI pointing at a resource describing the subset of the language that is 
allowed. This is not the difficult part, however. The difficult part is 
finding a suitable format for describing the allowed subset. For 
XML-like languages (HTML, BBcode, etc.) DTD or some other schema format 
might be appropriate (but might be too complex?). For other types of 
languages like 'magic character' languages (textile, wiki formats), it's 
not quite so clear what would work (one could avoid supporting these 
formats in the hope that with a good enough editing environment, people 
might use plain HTML but that might be a mistaken hope).

There is some evidence that this functionality is desired - for example 
the BBCode addon for Firefox [1]

I'm not expecting anything to come of this unless someone can convince 
me it's much easier to implement than it appears.

[1] http://extensionroom.mozdev.org/more-info/bbcode

"If anybody ever tells you that you’re using the language incorrectly, 
just yell 'prescriptive grammarian!' at the top of your voice and all 
the linguists in the building will run over and surround the guy... and 
then they’ll rough him up"

More information about the whatwg mailing list