From: Blake W. <bw...@la...> - 2008-09-05 20:52:29
|
Waylan Limberg wrote: > The problem is that CamelCase words that correctly appear in other > parts of the markup are mistakenly being identified as wikilinks. > > In the past this was not a problem because any markup in the labels > was ignored. Now that that bug is squished, I need a way to tell > markdown to not run the WikiLink pattern against the label. There are > currently two mechanisms to do that. One it to set each label as an > AtomicString. However, then we would again be back were we were with > nested markup being ignored in labels. Ooh, ooh! SemiAtomicString? ;) > The other solution is to reorder the InlinePatterns. I think that having patterns be order dependant isn't a great idea, in general. Could the WikiLink pattern be made more context-sensitive somehow, so that it wouldn't match if there it was inside a "Label"? > Interestingly, it > occurred to me that if InlinePattern was passed the parent element, we > could test ``parent_elem.tag != 'a'``, but even then, if that > CamelCase word is nested in strong or em tags, that test would fail. > Besides, I can't think of any other use for doing that. Well, if you could walk up your parents, you could check all of them for an 'a' (and check whether you were an attribute). It seems like it might be worth defining a couple of custom walkers, to handle cases where we want to expand stuff, but only if it occurs in non-link/non-attribute places. > Any thoughts? It's a tough problem, to be sure. Later, Blake. |