quartostamp icon indicating copy to clipboard operation
quartostamp copied to clipboard

Insert tabset overtypes existing code

Open Lextuga007 opened this issue 1 year ago • 2 comments
trafficstars

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
::

💮 😄

Lextuga007 avatar Jan 24 '24 19:01 Lextuga007

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.

matt-dray avatar Jan 25 '24 09:01 matt-dray

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.

matt-dray avatar Jan 25 '24 22:01 matt-dray