Topic on Extension talk:TemplateStyles

Sakretsu (talkcontribs)

Here you can see the normal behavior of a transclusion, whereas this test shows that Mediawiki does not recognize escapes due to templatestyles tags. I was wondering if this is intended. Wouldn't it be better not to force users to add a newline?

Tgr (WMF) (talkcontribs)

That's just how the MediaWiki parser works. Wikitext that needs to be at the beginning of the line (lists, tables, preformatting etc) cannot be preceded by markup, even if that markup is invisible. Compare

<indicator>...</indicator>* foo

for example.

Sakretsu (talkcontribs)

Sure, but my point is that we are supposed to make extensive use of TemplateStyles, and its tag has to be placed right at the beginning of each template code. If we want escapes to be detected, we have no choice but to add a newline, which leads to other problems, e.g. it wouldn't be possible to transclude the template inside indented text (beforeafter).

Anomie (talkcontribs)

The tag doesn't have to be placed right at the beginning of each template code. But it should be placed before what it's intended to style, so it can do so without a w:Flash of unstyled content.

BTW, I note the behavior you're wanting there (start-of-line behavior for parsing templates that aren't at start-of-line) is exactly what many people have complained about in T14974.

Tgr (WMF) (talkcontribs)

It's an unfortunate design choice, I'm not sure we can do anything about it though. After Parsing/Parser Unification has been finished, it will be easier to evolve the language and fix annoying corner cases like these, hopefully.

Reply to "Escapes"