Skip to content

html behaves unexpectedly when there is no indent #209

@marikaner

Description

@marikaner

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions