Description

HTML is much more than just ASCII and there are lots of characters that should be used (both for typographic correctness and ease of reading), but are hard to input from keyboard. HTML allows you to insert them as entities, like &emdash;, but MoinMoin won't allow it.

Method 1

This is used by some Wikis and Blogs, the idea is similar to that with smileys, only instead of inserting images, an HTML entity is inserted.

There's a filter that does this pretty well: http://daringfireball.net/projects/smartypants/

An exmaple:

expression

gets transformed into

" -- "

" --- "

" (C) "

©

" (R) "

®

" (TM) "

" (= "

" (- "

£

"... "

" "\b"

<q>

"\b" "

</q>

" --> "

" <-- "

" <-> "

" ==> "

" <== "

" <=> "

" o-o "

" . "

·

" !\b"

¡

" ?\b"

¿

" >> "

»

" << "

«

" 1/4 "

&frac14;

" 1/2 "

&frac12;

" 3/4 "

&frac34;

" >< "

×

"^o "

°ree;

This method is pretty convenient, but has some drawbacks. The combinations of characters are not normally used in normal text, but it might happend that they get used without the {{{ }}} or backticks, leading to strange behaviour. The quotation marks should be matched first, and then transformed into HTML markup. Also, there's additional markup to learn.

Method 2

Just list the symbols along the top or bottom of textarea, with JavaScript to insert them. The same could be done for smileys.

This is rather inconvenient (but you don't use those characters often) and requires JavaScript.

Discussion

Probably a tool box in the gui should be added to select grphical such a sign.

It'd be nice if you could insert such characters into text using some mechanism provided by the MoinMoin itself.

How about generating proper HTML markup for the quotations, so that "abc" would turn into <q>abc</q>? Is it possible with the default MoinMoin markup parser?

Something like this?

   1 class Q:
   2     def execute(macro, args):
   3         f = macro.formatter
   4         html = f.open('q') + f.text(args) + f.close('q')
   5         return html

And also a second macro could be useful:

   1 class Amp:
   2     def execute(macro, args):
   3         f = macro.formatter
   4         if not args in ['mdash', 'ndash', 'copy', 'trade', ]:
   5             return f.text("?")
   6         return f.rawHTML('&%s;'%args)


CategoryFeatureRequest

MoinMoin: FeatureRequests/InsertingSpecialCharctersWhenEditing (last edited 2009-09-06 09:10:09 by ReimarBauer)