Skip to content

whitespace in span is getting striped out #129

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

Open
flip111 opened this issue Mar 31, 2025 · 0 comments
Open

whitespace in span is getting striped out #129

flip111 opened this issue Mar 31, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@flip111
Copy link

flip111 commented Mar 31, 2025

Input

<div class="code-container">
  <ul class="root code-block">
    <li>
      <span class="type">Bar</span>
    </li>
    <li>
      <ul class="content">
        <li>
          <span class="indentation">  </span>
...truncated...

Output

<div class="code-container">
  <ul class="root code-block">
    <li>
      <span class="type">Bar</span>
    </li>
    <li>
      <ul class="content">
        <li>
          <span class="indentation"></span>
...truncated...

Problem
The two spaces in <span class="indentation"> </span> are gone.

My css looks like this

.indentation {
  display: inline-block;
  white-space: pre;
}

In case mangling whitespace is unavoidable consider:

  1. not disturbing whitespace when open and close tag is on the same line
  2. not disturbing whitespace specifically
  3. not disturbing whitespace when tag has white-space: pre; associated with it
@flip111 flip111 added the bug Something isn't working label Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants