Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Angle Brackets Bug

オープン
#240 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
tooling

調査の方向性

エントリポイント markdown2.markdown から開始し、safe_mode="escape" と safe_mode="replace" で指定された文字列を再現します。完了条件は、Cコードブロックで小なり記号が保持され、続く引用が両方の該当ケースで独立した Blockquote としてレンダリングされることです。

索引モデルが issue の本文から書いたものです。

説明

I noticed that in some scenarios, this bug can occur:

Suppose your string is the following:

>>> string =  """
... Start of test.
...
...     for (i=0; i<3; i++) {
...         printf("Hello, world.");
...     }
...
... > This is a quote
...
... End of test.
... """

I would expect the C-code snippet to be formatted as a code block, and the quote to be formatted as a blockquote.

However, when I use safe_mode="escape" (because I want users of this to be able to use HTML in the application), markdown2 thinks that there is a big HTML tag in this block from the less than symbol to the beginning of the blockquote:

>>> import markdown2
>>> markdown2.markdown(string, safe_mode="escape")
'<p>Start of test.</p>\n\n<pre><code>for (i=0; i&lt;3; i++) {\n        printf("Hello, world.");\n    }  \n\n&gt; This is a quote\n</code></pre>\n\n<p>End of test.</p>\n'
>>> markdown2.markdown(string, safe_mode="replace")
'<p>Start of test.</p>\n\n<pre><code>for (i=0; i[HTML_REMOVED] This is a quote\n</code></pre>\n\n<p>End of test.</p>\n'
>>>

This seems to be a bug, because it means I cannot have a blockquote after a block of code that uses a < symbol.

主要言語
Python
スター
2.8k
フォーク
459
平均マージ
2日 14時間
マージ済み PR(30日)
5

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

trentm/python-markdown2 のほかの issue

trentm/python-markdown2 の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。