adityatelange / adityatelange/hugo-PaperMod

[Bug]: Possible typo in TOC regex (`(.|\n])+?`)

オープン
#1,872 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
HTML
スター
13.9k
フォーク
3.4k
PR マージ指標
30日以内にマージされた PR はありません

説明

### What happened?

I may be mistaken, but I noticed what looks like a possible typo in layouts/_partials/toc.html.

The current regex is:

(.|\n])+?

It seems that there is an extra ] after \n.

Should it perhaps be:

(.|\n)+?

I noticed this while investigating why headings containing line breaks didn't seem to be matched. If I'm misunderstanding the intent or if this works correctly with Hugo's regex engine, please ignore this.

### Steps to reproduce

### Steps to reproduce

1. Create an Org file with the following content:

```org
#+TITLE: foo
#+showtoc: t

* Content
foo bar
```

2. Start the Hugo server:

```bash
hugo server
```

3. Open the generated page in a browser.

4. Observe that the Table of Contents is not displayed.

### Expected behavior

The page should display a Table of Contents containing the `Content` heading.

### Additional information

While investigating this issue, I noticed the following regex in `layouts/_partials/toc.html`:

```go
(.|\n])+?
```

It appears there may be an extra `]` after `\n`. I'm not sure whether this is intentional or a typo, but I thought it might be related.

### Hugo Version

Hugo >= 0.146.0 (Recommended - Minimum version required for PaperMod)

### PaperMod Version

154d006

### What kind of devices are you seeing the problem on?

Desktop

### What browsers are you seeing the problem on?

Firefox

### Browser Version

_No response_

### Relevant log output

```shell
No relevant log output.
```

### Repository/Source Code link where this issue can be reproduced

_No response_

### Code of Conduct

- [ ] I agree to follow this project's Code of Conduct

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

このリポジトリのコントリビューションガイドは索引されていません

評価

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

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

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