0

尝试在 MediaWiki(版本为 1.19)中创建引用模板 - cquote。Parser 似乎对文本流非常挑剔:相同的代码要么显示为垃圾,要么显示为正常,具体取决于新行的开始位置。例如:

{| style="margin:auto; border-collapse:collapse; border-style:none;class="cquote" {{#if: {{{bgcolor|}}} | border: 1px solid #AAAAAA;}}

| width="20" valign="top" style="color:#B2B7F2;font-size:35px; font-family:'Times New Roman',serif;font-weight:bold;text-align:left;padding:10px 10px;" | “
| valign="top" style="padding:4px 10px; font-style: italic;" | {{{1|Insert the text of the quote here, without quotation marks.}}}
| width="20" valign="bottom" style="color:#B2B7F2;font-size:35px; font-family:'Times New Roman',serif;font-weight:bold;text-align:right;padding:10px 10px;" | ”
|-
|}<!-- {{subst:FULLPAGENAME}} -->

这可以验证,但是当我稍微更改新行时,输出变得垃圾,我无法遵循逻辑,应该如何剪切新行。我想在新的线路定位上不应该有任何这样的敏感性,但不确定在哪里寻找。

{| style="margin:auto; border-collapse:collapse; border-style:none;class="cquote" {{#if: {{{bgcolor|}}} | border: 1px solid #AAAAAA;}}

| width="20" valign="top" style="color:#B2B7F2;
font-size:35px; font-family:'Times New Roman',serif;font-weight:bold;text-align:left;padding:10px 10px;" | “
| valign="top" style="padding:4px 10px; font-style: italic;" | {{{1|Insert the text of the quote here, without quotation marks.}}}
| width="20" valign="bottom" style="color:#B2B7F2;font-size:35px; font-family:'Times New Roman',serif;font-weight:bold;text-align:right;padding:10px 10px;" | ”
|-
|}<!-- {{subst:FULLPAGENAME}} -->
4

1 回答 1

0

原来我没有ParserFunctions extension激活,链接。这样做并且模板被解析好了。

于 2012-10-31T14:50:38.130 回答