zspecza / common-tags

🔖 Useful template literal tags for dealing with strings in ES2015+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`html` behaves unexpectedly when there is no indent

marikaner opened this issue · comments

I am trying no nest codeBlock (or html), but I am unable to do this for the root level indentation:

import { codeBlock } from 'common-tags';

const bc = () => codeBlock`
B
C
`;

const a = () => codeBlock`
A
${bc()}
  ${bc()}
`;

console.log(a());

gives me

A
B C
  B
  C

but I would expect it to be:

A
B
C
  B
  C