【问题标题】:mediawiki template editor sensitive on new linesmediawiki 模板编辑器对新行敏感
【发布时间】:2012-10-23 11:46:57
【问题描述】:

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

{| 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}} -->

【问题讨论】:

  • 我真的不明白你为什么要在样式属性的中间放一个新行。您能否解释一下为什么要在模板中添加新行以及在何处添加新行。

标签: templates mediawiki


【解决方案1】:

原来我没有激活ParserFunctions extensionlink。这样做了吗,模板被解析好了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-09
    相关资源
    最近更新 更多