Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolated / nested literals #216

Open
renatodeleao opened this issue Dec 14, 2021 · 0 comments
Open

Interpolated / nested literals #216

renatodeleao opened this issue Dec 14, 2021 · 0 comments

Comments

@renatodeleao
Copy link

Hey 👋
First thanks for this very useful package! Found it thanks to this article and is suuuper handy!

Description

I came across a situation where I need to interpolate a "partial" snippet (literal) within another for a documentation example.
I was expecting that a single call html|source|codeBlock would keep indentation correct but apparently, it doesn't. I wonder if this is expected due to some template literal quirk or an actual issue — If expected feel free to close, but a doc reference might be useful since this seems a fairly common scenario (if there's already one and I miss it, I'm sry in advance 😅 )

Demo

Extra context

  • Might be related to Support nested html #160
  • As you can see in the demo, calling html on each block (snippet) does the trick, but wondering if there's a way to achieve in a single call
  • The reason I'm asking for it is that I'm using this under the hood on a component, <AppSnippet :snippet="codeStr" />, and would like to support template literals whitespace handling under the hood using this package.

Cheers! ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant