### Bug description

Quarto 1.3.340 on macOS

The `_quarto.yml`

````yaml
project:
  type: website

website:
  navbar:
    left:
      - text: "home"
        file: index.qmd
````

The `index.qmd`

````markdown
# alpha

Alpha is first. Consider nothing else.


## First {#First}

The first section contains the first set of properties which must appear after
`[First]` in the configuration file.

### `First`  Settings {#First.Settings}

#### `SomeFirstSettingEnabled` {#First.SomeFirstSettingEnabled}

Enable the jump start examples for onboarding. 

#### `AnotherFirstSettingName` {#First.AnotherFirstSettingName}

Indicates how Posit Connect attempts to match the R version associated with
uploaded content with the R versions available on the system.

## Second {#Second}

The second section contains the second set of properties which must appear after
`[Second]` in the configuration file.

### `Second`  Settings {#Second.Settings}

#### `SomeSecondSettingEnabled` {#Second.SomeSecondSettingEnabled}

Enable the jump start examples for onboarding. 

#### `AnotherSecondSettingName` {#Second.AnotherSecondSettingName}

Indicates how Posit Connect attempts to match the R version associated with
uploaded content with the R versions available on the system.

## Third {#Third}

The third section contains the third set of properties which must appear after
`[Third]` in the configuration file.

### `Third`  Settings {#Third.Settings}

#### `SomeThirdSettingEnabled` {#Third.SomeThirdSettingEnabled}

Enable the jump start examples for onboarding. 

#### `AnotherThirdSettingName` {#Third.AnotherThirdSettingName}

Indicates how Posit Connect attempts to match the R version associated with
uploaded content with the R versions available on the system.

## Fourth {#Fourth}

The fourth section contains the fourth set of properties which must appear after
`[Fourth]` in the configuration file.

### `Fourth`  Settings {#Fourth.Settings}

#### `SomeFourthSettingEnabled` {#Fourth.SomeFourthSettingEnabled}

Enable the jump start examples for onboarding. 

#### `AnotherFourthSettingName` {#Fourth.AnotherFourthSettingName}

Indicates how Posit Connect attempts to match the R version associated with
uploaded content with the R versions available on the system.
````

The "AnotherFirstSettingName" term is not found.

<img width="531" alt="image" src="https://github.com/quarto-dev/quarto-cli/assets/362187/4c7b8f8a-f7ff-4780-846e-c10946f57177">

The "jump start" query repeats results.

<img width="870" alt="image" src="https://github.com/quarto-dev/quarto-cli/assets/362187/5708dd8c-6d89-40f7-8966-20911207bcce">

```
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.340
      Path: /Applications/RStudio.app/Contents/Resources/app/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.6
      Path: /Library/Developer/CommandLineTools/usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 3.6.3
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/3.6/Resources/library
      knitr: 1.42.8
      rmarkdown: 2.20

[✓] Checking Knitr engine render......OK
```

### Steps to reproduce

_No response_

### Expected behavior

_No response_

### Actual behavior

_No response_

### Your environment

_No response_

### Quarto check output

_No response_
dragonstyle
2023-05-26T20:20:34Z
aronatkins
bug
Future
open
built-in search misses sub-headings; double-reports results
https://github.com/quarto-dev/quarto-cli/issues/5711