preact-markup icon indicating copy to clipboard operation
preact-markup copied to clipboard

Not preserving spaces around <a> tags

Open laggingreflex opened this issue 8 years ago • 1 comments

This:

<div>1 <a>2</a> 3</div>
      ^ spaces ^

reproduces

<div>1<a>2</a>3</div>
      ^ not   ^

problem only found to be occurring with <a> tags so far

Edit: actually I think it's all nested tags, but then spaced in between nested tags is still preserved. Here's another case:

<div>1 <a>2</a> <b>3</b> 4</div>

reproduces

<div>1<a>2</a> <b>3</b>4</div>

laggingreflex avatar Mar 03 '17 13:03 laggingreflex

@laggingreflex try passing trim={false}, it turns off whitespace trimming. I think we do need to tweak it, but for your use-case that should fix.

developit avatar Mar 03 '17 14:03 developit