N3: The lonk you provides expects the transclusion (preprocessor 3.4) before tags (processor 2.2). So the follow parameter behavior is broken. Igal
בתאריך יום ה׳, 13 בדצמ׳ 2018 ב-18:25 מאת יגאל חיטרון < khitron@post.bgu.ac.il>:
The problem is the precedence, once again. I expect from the parser to parse wiki markup before parsing html tags, because templates can create new tags by transclusion. If the ref tag is parsed first, glueing the unbalanced parts to one proper template call, that means that (1) the template can't include ref tags with follow parameter, because they will not be parsed any more; or (2) after the transclusion the tags are parsed once again, with the same algorithm. Both variants look me as a bad choice. So the fact that the bad code I posted works is a symptom for a parser problem. Igal
בתאריך יום ה׳, 13 בדצמ׳ 2018 ב-18:17 מאת Thiemo Kreuz < thiemo.kreuz@wikimedia.de>:
The wikitext snippet you posted appears to be seriously broken. More precisely: It is unbalanced. Technically, there is no such thing as "broken" wikitext. The parser will always output something (as he does in the example). However, this doesn't mean such wikitext is ok. Sure, nobody is stopping anyone from writing unbalanced code. But it becomes unpredictable (as the example shows), unreliable, and effectively unmaintainable as it starts to heavily depend on quirky internal details of the parsers implementation, how it approaches certain aspects, and in which order they are processed.
The bigger problem here is this: Even if you figure out how the parser works right now, it might change, as it already did many times. Have a look at pages like https://www.mediawiki.org/wiki/Markup_spec to get an idea of how complex this topic is, and how many people tried how many times to nail it down, all failing for one or the other reason. Code like the one you showed depends so much on the tiniest implementation detail of the parsing process, it becomes so fragile that it might break any day for reasons nobody could ever anticipate without a warning.
Please balance your wikitext.
Best Thiemo
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l