0

DerobinのWMDエディターの実装に小さな問題があります。

正しくフォーマットされていないようで、理由はよくわかりません。Doctypeでこれを尋ねるべきかどうかはわかりませんが。

私はSOリファレンスのマークダウンテキストの例を使用していました。もちろん、これは次のようになります。

  1. リストアイテムのリスト:
    • インデントされた4つのスペース。
      • インデントされた8つのスペース。
    • 再び4つのスペース。
  2. リストアイテム内の複数の段落:段落を4スペースインデントするのが最善です。3スペースで逃げることができますが、他のものをネストすると混乱する可能性があります。4つに固執します。

    最初の行をこれらの段落に合わせるために余分なスペースをインデントしました。実際には、すべてのアイテムが揃うように、リスト全体に対してこれを行う場合があります。

    この段落はまだリスト項目の一部ですが、人間には乱雑に見えます。したがって、最初の2つで行ったように、ネストされた段落を手動でラップすることをお勧めします。

  3. リストアイテムのブロッククォート:

行をスキップして、>の4つのスペースをインデントします。

  1. リストアイテムのフォーマット済みテキスト:

    Skip a line and indent eight spaces.
    That's four spaces for the list
    and four to trigger the code block.
    

しかし、私が得るものは次のようになります。

問題の例

これはCSSに関連していると思いますが、原因がわかりません。必要に応じてCSSを投稿できますが、原因がわからないため、おそらくすべてを投稿します。ただし、それが実際のスクリプト自体である可能性があるかどうかはわかりません(例が機能し、まったく同じコードをコピーしただけなので、疑わしいと思います)。

また、WMDのダウンロードに付属する例はそれ自体で正常に機能しますが、アプリケーションに追加すると、上記のようになります。

また、この問題はIE7/8とFirefox3.5でも持続することを付け加えておきます。

どんな助けでも大歓迎です。


編集: list-style-position:inside;のolとulにCSSスタイルを追加して、ボックスの外側に表示される箇条書き/数字を解決しました。しかし、残りは同じままです。

編集:ユーザーのコメントに基づいて編集します。出力されるHTMLは次のとおりです。

<ol>
<li>Lists in a list item:
<ul><li>Indented four spaces.
<ul><li>indented eight spaces.</li></ul></li>
<li>Four spaces again.</li></ul></li>
<li><p>Multiple paragraphs in a list items:
It's best to indent the paragraphs four spaces
You can get away with three, but it can get
confusing when you nest other things.
Stick to four.</p>

<p>We indented the first line an extra space to align
it with these paragraphs.  In real use, we might do
that to the entire list so that all items line up.</p>

<p>This paragraph is still part of the list item, but it looks messy to humans. So it's a good idea to wrap your nested paragraphs manually, as we did with the first two.</p></li>
<li><p>Blockquotes in a list item:</p></li>
</ol>

<blockquote>
<p>Skip a line and
indent the >'s four spaces.</p>
</blockquote>

<ol>
<li><p>Preformatted text in a list item:</p>

<pre><code>Skip a line and indent eight spaces.
That's four spaces for the list
and four to trigger the code block.
</code></pre></li>
</ol>
4

1 に答える 1

2

あなたのcssファイルにはこれがあります:

* {
    margin:0;
    padding:0;
}

これは、すべてからパディングとマージンを削除するユニバーサルリセットです。Doctype.comで言ったように。

それを削除し、より制御可能なリセットを使用するか、一般的にulとliのデフォルトのパディングとマージンを設定する必要があります。

ブラウザごとにulのデフォルトが異なるように見えるので、リセットからそれらを省略して、navulを具体的に設定する傾向があります。

これが私が使用するリセットです:

div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, acronym, address, big, cite, code,
del, dfn, font, img, ins, kbd, q, s, samp,
small, strike, sub, sup, tt, var,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-weight: inherit;
    font-style: inherit;
    font-size: 100%;
    font-family: inherit;
    vertical-align: baseline;
    }

リスト以外のほとんどすべてをリセットします。

于 2009-10-07T11:13:59.937 に答える