From: Felix W. <Fel...@gm...> - 2004-11-08 19:40:25
|
David Goodger wrote: > I just implemented new options for the "unicode" directive: "ltrim", > "rtrim", and "trim" (trim whitespace from the left, right, or both > sides of substitution references when applied). Great; thank you. 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. Because recently could have used something like this: .. |,| raw:: latex :trim: \, .. "\," inserts a narrow space in LaTeX. This is a phone number: +12-34 |,| 56-7 |,| 89 |,| 01 This is the same number without nice spaces in LaTeX: +12-3456-78901 (Both numbers are rendered identically in HTML.) I could imagine similar scenarios for images, and possibly also for replacement text. >>> And other characters can be used as markup delimiters, not just >>> spaces. For example, hyphens can be used. >> >> I think that would be over-engineering. We don't *really* need it, >> do we? > > Perhaps not right away, but I anticipate it may become necessary if > the feature becomes popular. 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? -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ |