title: Issue rendering bookdown with bootstrap
body: <p>I am setting up a bookdown and struggling to render the book using bootstrap.
  I can render without issues using gitbook but run into errors using bootstrap. For now, the book is pretty simple so I am unsure where the issue lies.</p>
  <p>The error message from the Build window</p>
  <pre><code>output file: 04-project_02.knit.md
  
  &quot;C:/Program Files/RStudio/bin/quarto/bin/tools/pandoc&quot; +RTS -K512m -RTS bookdownproj.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output bookdownproj.html --lua-filter &quot;C:\Users\pierr\AppData\Local\R\win-library\4.2\bookdown\rmarkdown\lua\custom-environment.lua&quot; --lua-filter &quot;C:\Users\pierr\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\pagebreak.lua&quot; --lua-filter &quot;C:\Users\pierr\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\latex-div.lua&quot; --metadata-file &quot;C:\Users\pierr\AppData\Local\Temp\RtmpMFDSnn\file842c34876b8b&quot; --wrap preserve --standalone --section-divs --template &quot;C:\Users\pierr\AppData\Local\R\win-library\4.2\bookdown\templates\bs4_book.html&quot; --highlight-style pygments --number-sections --css style.css --mathjax --include-in-header &quot;C:\Users\pierr\AppData\Local\Temp\RtmpMFDSnn\rmarkdown-str842c423a75a.html&quot; 
  Tweaking docs/index.html
  Tweaking docs/introduction-to-networks-and-food-webs.html
  Tweaking docs/projects-in-this-portfolio.html
  Tweaking docs/how-to-simplify-networks-using-machine-learning-algorithms.html
  Tweaking docs/how-fast-are-you-based-on-characteristics.html
  Tweaking docs/404.html
  Error in xml_children(x)[[search]] : subscript out of bounds
  Calls: local ... bs4_chapter_tweak -&gt; tweak_navbar -&gt; template_link_icon -&gt; &lt;Anonymous&gt;
  Execution halted
  Error: bookdown::render_book() failed to render the output format 'bookdown::bs4_book'.
  Execution halted
  
  Exited with status 1.
  
  </code></pre>
  <p>My index.Rmd starts with</p>
  <pre><code>--- 
  title: &quot;My Title
  author: &quot;My name&quot;
  date: &quot;`r Sys.Date()`&quot;
  site: bookdown::bookdown_site
  url: https://mydomain.github.io/mybookdown/index.html
  output: 
    bookdown::gitbook:
        highlight: tango
  documentclass: book
  new_session: yes # use the K-M rendering method
  description: |
    Report of some project
      
  ---
  
  # About Me
  </code></pre>
  <p>I replace the names in URLs for anonimity. :) Still working on this.</p>
  <p>The _bookdown.yml file:</p>
  <pre><code>book_filename: &quot;bookdownproj&quot;
  new_session: true
  before_chapter_script: [&quot;_global_options.R&quot;, &quot;_before_chapter.R&quot;]
  output_dir: &quot;docs&quot;
  delete_merged_file: true
  edit: https://github.com/mydomain/mybookdown/edit/main/%s
  view: https://github.com/mydomain/mybookdown/blob/main/%s
  language:
    ui:
      chapter_name: &quot;Part &quot;
  </code></pre>
  <p>And the _output.yml:</p>
  <pre><code>bookdown::bs4_book:
    css: style.css
    theme:
      bootswatch: cerulean
      primary: &quot;#0403b2&quot;
    repo:
      base: https://github.com/mydomain/mybookdown.git
      branch: main
      subdir: docs/
  
  bookdown::gitbook:
    css: style.css
    config:
      toc:
        before: |
          &lt;li&gt;&lt;a href=&quot;./&quot;&gt;Data Science Report&lt;/a&gt;&lt;/li&gt;
        after: |
          &lt;li&gt;&lt;a href=&quot;https://github.com/mydomain/mybookdown.git&quot; target=&quot;blank&quot;&gt;View the repository&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;https://github.com/rstudio/bookdown&quot; target=&quot;blank&quot;&gt;Published with bookdown&lt;/a&gt;&lt;/li&gt;
      toc_float:
        collapsed: TRUE
  
  </code></pre>