简体   繁体   English

如何禁用Markdown代码块生成?

[英]How do I disable Markdown code block generation?

I have an unusual situation. 我有一个不寻常的情况。 I am in a transitional state for a website that will eventually be a wiki-like site that uses markdown files to generate documentation. 我处于一个过渡状态,该网站最终将是一个使用markdown文件生成文档的类似Wiki的网站。 However, for our phase 0 demonstration to upper management, I need to use HTML instead of markdown for advanced layouts. 但是,对于向高层管理人员进行的第0阶段演示,我需要使用HTML而不是markdown进行高级布局。 This leads to large portions of the Markdown files being HTML. 这导致Markdown文件的大部分是HTML。 Generally speaking, this is working fine, but sometimes the "4 spaces means code block" "feature" of markdown means that instead of rendering the page, I just get the HTML pasted to the screen in a <pre>. 通常来说,这可以正常工作,但有时“ 4空格表示代码块” markdown的“功能”意味着我没有呈现页面,而是将HTML粘贴到了<pre>中。

So, my question is, how can I turn off the "4 spaces means code block" thing? 因此,我的问题是,如何关闭“ 4个空格意味着代码块”的东西? IMO, this is an idiotic design in the first place, but it's really screwing with my current project! IMO,这首先是一个愚蠢的设计,但这确实与我当前的项目搞砸了!

For example: 例如:

I have a banner 我有条幅

<div class="banner detail">
    <div class="banner-inner">
        ...
    </div>
</div>

On some pages, this renders exactly as expected. 在某些页面上,这将完全按预期呈现。 On others, it spits out the "banner-inner" div and everything inside it to the page. 在其他页面上,它吐出“ banner-inner” div及其内部的所有内容到页面。 Hell, even convincing this editor to display that code snippet instead of processing it took 5 minutes of trial and error poking... 地狱,甚至说服该编辑器显示该代码段,而不是处理它,这花了5分钟的反复试验...

Please, some one help me turn off or get around (without simply not using indenting...) this "feature"!! 请有人帮我关闭或绕开(不要简单地不使用缩进...)这个“功能”!

Sadly, whether this "feature" can be turned off is relegated to a customization question for the specific software package in use. 可悲的是,是否可以关闭此“功能”是针对所使用的特定软件包的定制问题。

On the bright side, I was able to eventually determine that the specific problem I was having was caused by the engine interpreting invalid HTML code (ie, missing a closing tag) as code to be displayed rather than processed. 从好的方面来说,我最终能够确定我遇到的特定问题是由于引擎将无效的HTML代码(即,缺少结束标记)解释为要显示而不是处理的代码而引起的。 So in the end, seeing this happen actually tended to mean that I had a bug to fix. 所以最后,看到这种情况实际上意味着我有一个要修复的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM