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

[Markdown Preview] Save as HTML and Copy as HTML stopped working with file that has fenced code blocks since Atom 1.32.0 #1044

Open
5 tasks done
catscarlet opened this issue Jul 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@catscarlet
Copy link

catscarlet commented Jul 1, 2024

Thanks in advance for your bug report!

  • Have you reproduced issue in safe mode?
  • Have you used the debugging guide to try to resolve the issue?
  • Have you checked our FAQs to make sure your question isn't answered there?
  • Have you checked to make sure your issue does not already exist?
  • Have you checked you are on the latest release of Pulsar?

What happened?

This is a good-old-classic bug since 2018. See this: atom/markdown-preview#552

The "Save As HTML" and "Copy As HTML" functionalities in the MarkDown preview doesn't work anymore if your file has a fenced code block.

It seems that the problem began since 2018 v1.32.0 of Atom, and it is still there in Pulsar nowadays.

Pulsar version

1.118.0

Which OS does this happen on?

🐧 Debian based (Linux Mint, Ubuntu, etc.)

OS details

Linux Mint 20.3 (based on Ubuntu 20.04)

Which CPU architecture are you running this on?

x86_64/AMD64

What steps are needed to reproduce this?

  1. Open a Markdown file, or create new - the file must have a fenced code block e.g.
      # Hello World
      
      ```
      console.log();
      ```
  1. Ctrl + Shift + M to open the Markdown Preview
  2. Ctrl + Shift + S to save Save as HTML (or Ctrl + Ins for "Copy As HTML")
  3. Save the HTML (or Paste the HTML to somewhere you like)
  4. Check the result

Expected result:

  • If you choose Save the HTML, a new HTML file is saved.
  • If you choose Copy As HTML, a HTML content will be in/replace clipboard, and you can paste it in anywhere you want.

Actual result:

  • If you choose Save the HTML, nothing will happen. No new save file will be created.
  • If you choose Copy As HTML, nothing will be in/replace clipboard, thus nothing expecting will be pasted.

Additional Information:

This is a very old bug since Atom 1.32.0 and they did nothing about it since 2018.

The OS and the CPU arch do not matter.

You can get all information on atom/markdown-preview#552

@catscarlet catscarlet added the bug Something isn't working label Jul 1, 2024
@catscarlet catscarlet changed the title [Markdown Preview] Save as HTML and Copy as HTML stopped working with files that have fenced code blocks since Atom 1.32.0 [Markdown Preview] Save as HTML and Copy as HTML stopped working with file that has fenced code blocks since Atom 1.32.0 Jul 1, 2024
@savetheclocktower
Copy link
Sponsor Contributor

The underlying problem here is that Pulsar does some magic for each embedded code block in the Markdown. That magic needs to go async. A large Promise.all is set up to aggregate all the promises over the entire file, but some of them never resolve. The ones that don't resolve seem to be the TextMate-style grammars — in my experiments, plain text and CoffeeScript didn't resolve.

(This is a note to my future self.)

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