multiple html files table of contents merging into one

Im currently building an app, and want to display some writen information in different tabs. each tabs contents comes from an external HTML file made using a markdowns file that has been knitted. each HTML file has its own table of contents.

but i have run in to an issue that i havent found the answer to: the table of contents for each of the two files are merged in the shiny app, so that one page gets a tabel of contents containing all the headers, and the other page gets no table of contents, but a thin grey line that i assume is the border of the table of contents.

is there a solution so that they each get ther table of contents?

code for an example is shown below:

as you kan se, the table of contents is merged on page one, and empty on page 2.
cant add

this is an example app with the same setup


ui <- fluidPage(
  tabsetPanel(id = "panels",
    tabPanel(title = "page 1",
  tabPanel(title = "page 2",

server <- function(input, output, session) {

shinyApp(ui, server)

.rmd file for creating the html file for the first page

title: "Norway"
    toc: true
    toc_float: true


<h3>1. The Natural Beauty of Norwegian Flowers</h3>
Norway, with its breathtaking landscapes and pristine natural surroundings, is home to a stunning variety of flowers. From the rugged mountains to the picturesque fjords, the country offers a diverse range of ecosystems that nurture an abundance of floral species. In spring and summer, the Norwegian countryside comes alive with vibrant colors as wildflowers carpet the meadows and forests. The sight of delicate blossoms amidst the lush greenery is a true feast for the eyes and a testament to the untouched beauty of Norway's floral kingdom.
<h3>2. Native Norwegian Flowers</h3>
Norway boasts several native flower species that have adapted to the country's unique climate and terrain. The national flower, the pasqueflower (Pulsatilla vulgaris), is a beautiful purple flower that typically blooms in the spring. Another iconic Norwegian flower is the globe flower (Trollius europaeus), with its bright yellow petals resembling a miniature sun. The Arctic starflower (Trientalis europaea) is a delicate white flower that thrives in Norway's subarctic regions. These native flowers not only add charm to the Norwegian landscape but also play a vital role in supporting local ecosystems and wildlife.
<h3>3. Gardens and Floriculture in Norway</h3>
In addition to its wildflowers, Norway also boasts impressive gardens and a thriving floriculture industry. The country's botanical gardens, such as the University Botanical Garden in Oslo, showcase a wide variety of plants and flowers from around the world. Visitors can immerse themselves in carefully curated displays of colorful blooms and learn about the rich flora that exists both locally and globally. Moreover, Norwegians have a deep appreciation for flowers and often adorn their homes, offices, and public spaces with floral arrangements. Florists across the country offer an array of fresh flowers, allowing people to brighten their surroundings and celebrate the beauty of nature in their daily lives.
Whether it's the untamed beauty of wildflowers or the carefully cultivated blooms found in gardens, flowers in Norway hold a special place in the hearts of both locals and visitors. The rich diversity and stunning colors of Norwegian flowers are a reflection of the country's commitment to preserving its natural heritage. Exploring the floral wonders of Norway is an enchanting experience that reveals the profound connection between the country's people, landscapes, and the delicate beauty of flowers.

.rmd file for creating the html file for the second page

title: "Egypt"
    toc: true
    toc_float: true

<h3>1. Flourishing Floral Treasures of Egypt</h3>
Egypt, a land of ancient wonders and timeless beauty, is also blessed with a rich tapestry of flowers. From the fertile Nile Delta to the arid expanses of the desert, Egypt's diverse landscapes offer a sanctuary for a wide array of floral species. The country's warm climate and fertile soils create an ideal environment for flowers to flourish. In the springtime, vibrant blooms adorn the banks of the Nile River, transforming the landscape into a colorful paradise and captivating the hearts of all who witness this natural spectacle.

<h3>2. Indigenous Egyptian Flowers</h3>
Egypt is home to several indigenous flower species that have adapted to the unique conditions of the region. One such iconic flower is the lotus (Nelumbo nucifera), which holds great cultural and religious significance in Egyptian history. The lotus, with its enchanting pink or white petals, has been revered as a symbol of rebirth and purity for centuries. Another notable flower is the desert rose (Adenium obesum), known for its striking appearance and ability to thrive in the arid desert landscapes. Egyptian flowers, with their resilience and beauty, serve as a reminder of the country's deep connection to nature.

<h3>3. Floral Heritage and Gardening in Egypt</h3>
Egyptian culture has a long-standing tradition of appreciating and cultivating flowers. The country's botanical gardens, such as the Orman Garden in Cairo, showcase a stunning variety of local and exotic flowers. These meticulously curated gardens provide a tranquil retreat where visitors can immerse themselves in the fragrant blooms and marvel at the diversity of Egypt's floral heritage. Moreover, Egyptians often incorporate flowers into their daily lives, using them for celebrations, religious ceremonies, and even medicinal purposes. Florists and flower markets throughout the country offer a vibrant selection of flowers, allowing Egyptians to express their love for nature's gifts in various ways.

The abundance of flowers in Egypt is a testament to the country's natural wealth and the resilience of its ecosystems. Exploring the floral wonders of Egypt reveals a deep-rooted connection between the land, its people, and the intricate beauty of flowers. Whether it's the delicate petals of the lotus or the tenacity of desert roses, Egyptian flowers continue to captivate hearts and serve as a reminder of the timeless allure of this ancient land.

this text is gibberish made with chatGPT

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.