developit / developit/htm

Improve runtime error handling for missing close tags

オープン
#166 コメント 5 件 リアクション 1 件 担当者 0 名 GitHub で見る
debugging duplicate enhancement proposal
主要言語
JavaScript
スター
9k
フォーク
181
PR マージ指標
30日以内にマージされた PR はありません

説明

Consider this sample code, which accidentally omits a closing tag.

```js
import htm from 'https://unpkg.com/htm?module'
const h = (type, props, ...children) => ({type, props, children});
const html = htm.bind(h)

console.log(JSON.stringify(html`

Hello, world!`));
```

In this case, the user intended to include a closing tag `

`, and so the user's desired logged result is `{"type":"h1","props":null,"children":["Hello, world!"]}`

Actual: `["h1","Hello, world!"]` The element name is incorrectly handled as a text node.

Expected: Throw an exception.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

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

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