当我放置C++预制文本中的代码

发布于 2025-01-24 07:41:13 字数 159 浏览 2 评论 0原文

我想使用MediaWiki记录C ++编码项目。我将代码片段丢进了预制的文本块中。问题是,当我包含一行代码时,例如:

if(x == y)

它会打破页面。 我假设解析器认为是标记打开标题,而没有匹配的近距离。

有没有办法标记==,以免将其视为标记。找不到参考。

I want to use MediaWiki to document a C++ coding project. I am dropping code snippets into a preformatted text block. The problem is, when I include a line of code like:

if(x == y)

it breaks the page.
I'm assuming the parser thinks is markup opening heading with no matching close.

Is there a way to mark the == so that it isn't taken as markup. Haven't been able to find a reference.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

⊕婉儿 2025-01-31 07:41:14

激活 syntaxhighlight> syntaxhighlight 在您的localsettings.php with wfloadextension('Syntaxhighlight_geshi'); 。确保/path/to/extensions/syntaxhighlight_geshi/pygments/pygmentize具有执行权限,并使用< syntaxhighlight lang =“ c ++” c ++“ c ++” ;

< pre> ...</pre>包裹片段,

将摘要的每一行缩进至少一个空间。

Activate SyntaxHighlight in your LocalSettings.php with wfLoadExtension( 'SyntaxHighlight_GeSHi' );. make sure /path/to/extensions/SyntaxHighlight_GeSHi/pygments/pygmentize has execution permissions and wrap your code snippets with <syntaxhighlight lang="C++">...</syntaxhighlight>,

OR

wrap your snippets with <pre>...</pre>,

OR

indent every line of your snippets with at least one space.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文