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

Multiple headings on a single line without newline are broken between MD and RT modes

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

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

h1 と h2 のインライン HTML でラウンドトリップを再現し、その後 markdown-serializer.ts、特に defaultMarkdownSerializerNodes.heading と customMarkdownSerializerNodes.html_block を調べます。Markdown と Rich Text を切り替えたときに、両方の見出しが 1 つの無効なタグに結合されず保持されれば完了です。

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

説明

bug commonmark html

Describe the bug
When multiple heading HTML tags are inlined without a newline at the end of the line, switching between Markdown and Rich Text mode will mangle the resulting headings into a single invalid tag, breaking the output.

To Reproduce
Steps to reproduce the behavior:

In Markdown mode, paste the following HTML into the editor. Ensure there are no newlines.

<h1>Heading1</h1><h2>Heading2</h2>

Switch to Rich Text mode and back to Markdown mode

You'll now see <h1Heading1h1h2>Heading2</h1Heading1h1h2>

Expected behavior
I expect the round-trip to preserve the headings as they were at the start.

Hunches:

When a heading in pure HTML is serialized, if it doesn't have a newline at the end, it goes through the heading: method of defaultMarkdownSerializerNodes in markdown-serializer.ts. If it has a newline at the end, it'll instead go through html_block() of customMarkdownSerializerNodes in the same file.

Screenshots
heading-merge-bug

Desktop (please
complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 103
主要言語
TypeScript
スター
440
フォーク
61
平均マージ
4日 3時間
マージ済み PR(30日)
16

環境構築

はじめの一歩

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

StackExchange/Stacks-Editor のほかの issue

StackExchange/Stacks-Editor の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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