番号以外のマーカーを持つ順序付きリスト

リクエスト:\u0026lt;ol\u0026gt;type 属性をホワイトリストに追加してください。同様の(ただしより一般的な)理由から、\u0026lt;ol\u0026gt;reversed 属性と、\u0026lt;li\u0026gt;value 属性についても同様の対応を行うことを提案します。

目的:これらの属性は、順序付きリスト項目のマーカー自体がリストの内容に意味を伝える場合に使用されることを意図しています。通常、リスト項目がこのマーカーを通じて参照される場合に該当します。これは、マーカーの選択に重要な目的がない場合に使用される CSS の list-style-type とは対照的です(ただし、フォーラム全体のローカライゼーションに推奨されている例もあり、これは非常に素晴らしいですね!)。

背景:公式の参照文書を引用しようとした際、リストのフォーマットにおける明らかな制限が発見され、正確な引用ができなくなっていました。多くの場合、リストマーカーは単に装飾的なものです。しかし、リストを多用する文書では、参照を容易にするために使用されることもあります。例えば、公式文書や法的文書では、リスト項目(またはサブ項目)がリストマーカーによって参照されることがあります。「公式文書 第 I 条、第 1 項(a)(i) 号」などです。

Markdown については、CommonMark 仕様に言及はなく、実際には数字(0-9)のみを指定しています。しかし、ほとんどのインタプリタ(markdown-it も含む)がリストに文字を許可していない一方で、いくつかのインタプリタは許可しています

BBCode において標準的な方法が存在するかどうか、BBCode の標準性が限定的であるため確信が持てません。任意の数字から開始する以上の高度な機能は見つかりませんでした。いずれにせよ、Discourse では BBCode のリストタグは使用されていないようです。

HTML および HTML+スタイルでは、どちらも正しい結果を生成しません:

「いいね!」 3

Looking at GitHub, implementing this would likely be simply a matter of adding them to this list:
https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/white-lister.js#L181-L183

Though I do notice that introducing these will leave the HTML-to-markdown converter unaware of these attributes. But as demonstrated above, markdown-it currently can’t handle markdown syntax representing these anyway. For that, it may be desirable to go a step further and implement list types in CommonMark…

「いいね!」 2

There are no plans for this.

The lack of this makes it very difficult to quote official documents, legal documents, software licenses, or anything else which use non-number markers for document references.

「いいね!」 1

Add a wrapper to those lists and some CSS

In posts use:

[wrap="letterlist"]
1. is the first
2. is the second.
3. is the third
[/wrap]

IN your theme add:

.cooked div[data-wrap="letterlist"]
  list-style: upper-alpha;
}
「いいね!」 1

That’s a good solution if the goal is arbitrary list decorations, but the HTML type attribute is specifically meant for semantically-meaningful situations where the difference between list markers are more than decorative. From <ol>: The Ordered List element - HTML: HyperText Markup Language | MDN

Unless the type of the list number matters (like legal or technical documents where items are referenced by their number/letter), use the CSS list-style-type property instead.

It’s a common enough need that although the HTML attribute was deprecated in HTML 4.01 (with justification of it being purely stylistic), it was subsequently re-introduced in HTML5 for the specific purpose of encoding reference lists as described by MDN.

「いいね!」 1

このソリューションを試したところ、うまくいきました。CSS を以下のように修正しました(最初の行に ol { が欠けていました)。

.cooked div[data-wrap="letterlist"] ol {
  list-style: upper-alpha;
}

しかし、エディターのプレビューウィンドウに表示させることができません。これはほとんどのユーザーにとって問題となるでしょう。ウェブブラウザで検査してみましたが、カスタム CSS が読み込まれていないか、プレビューに適用されていないようです(私はこの分野の専門家ではないので、間違っているかもしれません)。

この問題を解決する方法を何か思いつきますか、@Falco さん?

「いいね!」 1

HTML がサポートされるようになったと思います。

  1. これ
  2. 他のもの
  3. 何か別のもの
<ol type="A">
<li> これ
<li> 他のもの
<li> 何か別のもの
</ol>

また、AaIi のタイプもサポートされています。

さらに、reversedstart= もサポートされています。

  1. パン
  2. ポテトチップス
  3. スイカ
<ol reversed start="36">
<li> パン
<li> ポテトチップス
<li> スイカ
</ol>

HTMLをそのように使用すると、<li>内のMarkdownの解釈が無効になるようで、ユーザーに提案するには実際には受け入れられません。

「いいね!」 1

HTMLバージョンを使用する必要があると思います。それらは混在させることを好まないためです。

  1. Bread
  2. Chips
  3. Watermelon
<ol reversed start=36>
<li> <b>Bread</b>
<li> <i>Chips</i>
<li> <strike>Watermelon</strike>
</ol>

わかっています。先ほど申し上げたように、ユーザーにそのような提案をすることは受け入れられません。リストの表示を少し変えたいという理由だけで、マークアップが完全に変わってしまうからです。

お役に立てず申し訳ありません。

もしかしたら、既存のソリューションの調整方法について助けを求める Dev トピックを開始すれば、誰かがお手伝いできるかもしれません。:+1:

「いいね!」 1