matt-dray/quartostamp

Insert tabset overtypes existing code

Lextuga007 opened this issue · 2 comments

Following on from the function update in #6 when I have headers like:

## Overview
## Covid cases

And highlight before selecting Insert tabset I get:

::: {.panel-tabset}

## Tab A

## Overview
## Covid cases

## Tab B

Content for Tab B

:::

And I'm really wanting:

::: {.panel-tabset}
## Overview
## Covid cases
::

💮 😄

Thank you, I agree. We can probably be a bit smarter and guess the user's intention; if two or more headers are selected then they're probably intended as tabset headers. I'll take a look at this.

There might also be some other functions in the package that would benefit from guessing user intention a bit better.

Note to self: stamp_tabset() is hard-coded for a two-tab tabset. Will need to detect the number of tabsets a user has intended and iterate over them to generate the return string.