Is your feature request related to a problem?
I needed to use jQuery's before and after and it would have been convenient if these macros already existed.
Describe the solution you'd like.
Implement a <<before>> and <<after>> that functions like <<prepend>> and <<append>>, only they call jQuery's before and after, respectively.
Describe alternatives you've considered.
I've implemented my own <<before>> and <<after>> by copying, pasting, and modifying the <<append>> macro:
Is your feature request related to a problem? I needed to use jQuery's before and after and it would have been convenient if these macros already existed.
Describe the solution you'd like. Implement a
<<before>>
and<<after>>
that functions like<<prepend>>
and<<append>>
, only they call jQuery's before and after, respectively.Describe alternatives you've considered. I've implemented my own
<<before>>
and<<after>>
by copying, pasting, and modifying the<<append>>
macro:https://github.com/tmedwards/sugarcube-2/blob/bac3c41252bd5a7bcc51b9721c31528e8d2ae663/src/macros/macrolib.js#L2348
Additional context. This conversation started on discord.
This may help summarize the difference between append and after:
$(x).append(y)
:$(x).after(y)
: