【发布时间】:2016-02-26 17:39:17
【问题描述】:
有没有办法强制 <code> 标签尊重 Mediawiki 中的单行?我真的不想使用 Poem 扩展,因为我觉得它看起来很难看。例如:
<poem>
<code>
Here's a block of code.
With two lines.
</code>
</poem>
我认为这看起来有点糟糕......关于只允许代码标签单独完成这个技巧的任何建议?
【问题讨论】:
有没有办法强制 <code> 标签尊重 Mediawiki 中的单行?我真的不想使用 Poem 扩展,因为我觉得它看起来很难看。例如:
<poem>
<code>
Here's a block of code.
With two lines.
</code>
</poem>
我认为这看起来有点糟糕......关于只允许代码标签单独完成这个技巧的任何建议?
【问题讨论】:
没关系。只需简单地使用<pre class="code">,它就可以完成我想做的每一件事。
【讨论】:
也可以使用https://www.mediawiki.org/wiki/Extension:SyntaxHighlight,它也可以很好地处理新行。
示例代码:
<syntaxhighlight lang="css">
.class {
some-css;
}
</syntaxhighlight>
【讨论】: