From: David G. <go...@py...> - 2003-06-19 02:09:00
|
Mark Nodine wrote: > I don't know whether this issue has been discussed before, It has, several times, most recently on the docutils-users list (which is worth reviewing and subscribing to; sometimes techical developer discussions start there). For references see <http://docutils.sf.net/spec/notes.html#nested-inline-markup>. > Would this proposal be something the python community > would be interested in duplicating? It's certainly food for thought, and may advance the discussion. I need to go back over the previous discussions and summarize them in a "Record of reStructuredText Syntax Alternatives" section (http://docutils.sf.net/spec/rst/alternatives.html). > Here's the description from my release notes: > > * Updated the parser to be able to handle many cases where inline > markup is nested within other inline mark-up. For example:: > > .. |myfignum| replace:: 1 > .. _Figure |myfignum|: > > **Figure |myfignum|.** Statistical heights for Gorm populations. > > As you can see in `Figure |myfignum|`_, ... That's an interesting idea. With the present parser, the explicit target will maintain the substitution reference text as-is, without interpretation. What does an implicit target (e.g. a section title containing a substitution reference) do? > There are limitations which require extra backslash quoting, > primarily dealing with nesting markup that uses the same markup > character. That's the crux of the matter, discussed way back on the Doc-SIG list IIRC. > For example, it is straightforward to nest an emphasized within a > strong, but not a strong within an emphasized. For example:: > > ***Emphasized text* within strong text** is fine. **Strong** is short for "strong emphasis". And as you said, "certain things like emphasized within emphasized don't make sense". Although *emphasis* is usually rendered as italics, and **strong emphasis** as boldface, these are simply conventions. **Strong emphasis** is simply stronger than *emphasis*. It doesn't really make sense to combine them: strong emphasis + emphasis = ? Stronger emphasis? > ***Strong text** within emphasized* does not work, since this > gets parsed as "*Strong text" being strong, and then finds there > is no matching close for the emphasis beginning before "Strong". > > However, the parser removes one level of backslashes for every > level of nesting, so that with judicious use of backslashes, you > can get the desired behavior:: > > Thus, *\**Strong text\*\* within emphasized* **does** work. Escaping is meant to *remove* markup significance, not add it or defer it. That's a major flaw in the proposal. Apart from sheer ugliness, I'd have a hard time accepting that meaning for backslash escapes. It's a fundamental incompatibility. > Nesting inline markup is turned off by default. To use it, you > must supply the flag > > -D nestinline Allows nesting of inline markup. > > * Updated the html writer to allow for nested emphasis, strong, etc. Until this code is actually available somewhere, there's not much point telling us about these details. Hint hint. --David Goodger |