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

Converting rich text copied from VS code results in bad markdown #485

Open
FezVrasta opened this issue Oct 18, 2024 · 0 comments
Open

Converting rich text copied from VS code results in bad markdown #485

FezVrasta opened this issue Oct 18, 2024 · 0 comments

Comments

@FezVrasta
Copy link

When I copy the following code from VS code and read it from the clipboard I get this HTML:

CleanShot 2024-10-18 at 5  56 05@2x

<meta charset="utf-8" />
<div
  style="
    color: #d8e2ec;
    background-color: #171d23;
    font-family: 'Fira Code', Menlo, Monaco, 'Courier New', monospace, Menlo,
      Monaco, 'Courier New', monospace;
    font-weight: normal;
    font-size: 13px;
    line-height: 20px;
    white-space: pre;
  "
>
  <div>
    <span style="color: #9d7cd8; font-style: italic">const</span
    ><span style="color: #d8e2ec"> </span
    ><span style="color: #bb9af7">turndownService</span
    ><span style="color: #d8e2ec"> </span><span style="color: #89ddff">=</span
    ><span style="color: #d8e2ec"> </span><span style="color: #89ddff">new</span
    ><span style="color: #d8e2ec"> </span
    ><span style="color: #7aa2f7">TurndownService</span
    ><span style="color: #9abdf5">()</span><span style="color: #89ddff">;</span>
  </div>
  <div>
    <span style="color: #c0f0f5">turndownService</span
    ><span style="color: #89ddff">.</span><span style="color: #7aa2f7">use</span
    ><span style="color: #9abdf5">(</span><span style="color: #c0f0f5">gfm</span
    ><span style="color: #9abdf5">)</span><span style="color: #89ddff">;</span>
  </div>
  <br />
</div>

The resulting markdown is:

  

const turndownService = new TurndownService();

turndownService.use(gfm);

I would expect it to result in:

const turndownService = new TurndownService();
turndownService.use(gfm);
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