From: David G. <go...@py...> - 2004-11-10 04:11:24
|
[Felix Wiemann] > I'm just wondering if it were a good idea to allow these options for > all directives (not only "unicode") when they occur in a > substitution definition. Seems like a good idea to me. [David Goodger] >>>> And other characters can be used as markup delimiters, not just >>>> spaces. For example, hyphens can be used. ... > On a second thought, it might be very useful indeed. :) > > .. |--| unicode:: U+2013 > .. en-dash, trimming only hyphens, not spaces > :trim: - > > This is an en-dash |--| as you would insert it in German and > sometimes in English (mostly UK, I think). And this is a range > from 50 to 100: 50-|--|-100; rendered as 50<endash>100, without > spaces. > > Syntax proposal: > > ":ltrim:" adds ltrim=" " as attribute; ":ltrim: -" adds > ltrim="-"; same for any other character. It is not possible to > activate trimming of multiple characters (e.g. both spaces and > hyphens). > > Same for :rtrim: and :trim:. > > What d'you think? Useful or feature creep? Potentially useful. The "trim" attributes would have to match the context for the substitution to be applied. And multiple contexts would have to be supported. So we'd have to support multiple substitution definitions with the same substitution text but different trim contexts. -- David Goodger <http://python.net/~goodger> |