-
Notifications
You must be signed in to change notification settings - Fork 357
Save as HTML
and Copy as HTML
stopped working in 1.32.0 with files that have fenced code blocks
#552
Comments
Thanks for opening a new issue 👍 I was unable to reproduce on 1.32.2 with macOS 10.12.6. What operating system are you running? Also tried on Windows 10 but couldn't reproduce there either. Can you also open the keybinding resolver and share a screenshot of what you see when you try to ctrl+shift+s or ctrl+c from the preview pane? |
I'm on Windows 10. Here are the screenshots : Note that I also updated git-plus before restarting Atom. Note that using the context menu with right click and select "Save As HTML" or "Copy As HTML" does not work either. |
Thanks for the screenshots, they look correct so not sure why nothing's happening with those commands 🤔 And it's just those commands with Markdown Preview that's not working? E.g. does ctrl-shift-s work in the Markdown file itself rather than the preview pane to "Save As" or does that also not work? If you temporarily reset to factory defaults, does that make any difference? |
Same issue. Unable to save html file from md file. md file created in atom. |
Tried a variation. From test.md file, attempted to do a save as test.html extension, got an exception, known issue reported under: Ubuntu 18.10 If I run atom with sudo, creates the html file but is a protected file, still cannot view in Chromium browser. |
Same issue, unable to save some md files to html files. And I realized that these files unable to save are included fenced code blocks starting with ``` . I replaced ``` to div tag, then able to save html files. same as me? |
Yep, I tried without the triple backticks and it worked as expected. |
Ahhh ok, I can reproduce now with just: # Hello World ``` console.log(); ``` Looks like this stopped working in 1.32.0 and worked in |
Save as HTML
and Copy as HTML
stopped working in 1.32.0 with files that have fenced code blocks
Got the same issue today. Atom: 1.32.2 x64 |
EDIT: Removing that line fixes saving for me but breaks two tests. |
I'm having this same issue with Atom 1.33.0 on Mac OS X 10.14.1. Can't get Save As HTML or Copy As HTML to work from the preview. I have indented code blocks in my source markdown but I do not have fenced code blocks in it. I can reproduce the issue in safe mode as well. |
I am having the issue with 1.33.0 on OS X 10.14 as well. I'm seeing a weird blocking issue in devtools when trying to make the call. I do have code blocks in my example.
|
I still see this issue in 1.34.0. This is super annoying. Indeed, it seems related to using ~~~ and/or ``` in a document. |
Using div tag can saved as html, but if I wrote
this code , it happened the same issue. |
Same issue for Atom v1.37.0 on Ubuntu 19.04 |
Specifying a language (any language) in the fenced code block is a workaround. So this ```c IF MODE=1 THEN SIPFL := TRUE; ELSEIF MODE=2 THEN NOFLT := TRUE; ``` works fine in a markdown file, but this: ``` IF MODE=1 THEN SIPFL := TRUE; ELSEIF MODE=2 THEN NOFLT := TRUE; ``` fails to save as HTML. I'm using Atom 1.37.0, markdown-preview 0.159.25. |
Still happens in v1.38.2, OSX. The workaround from @ShaneHoran works. |
This also happens on Ubuntu 19.04. Can confirm that the workaround from @ShaneHoran works for me too. Would be great to get this fixed, there is no error thrown at all so it takes forever to figure out what's going on when you hit this bug. |
In case it's helpful to know, for me this is triggered by double-tab indentation blocks, not the "three ticks" blocks. If I get rid of that the save works fine. |
I ran into this problem today using indented code blocks (4 space indent). I have to switch to explicitly declared code blocks (using 3 ticks) AND specify a language or save-as-html silently fails. Atom: 1.38.2 Windows x64 |
I did some work to track this down. Let me preface the following by saying that I haven’t written code for a living in a while, and I don’t know JavaScript very well… Just trying to contribute to this getting fixed. In the “markdown-preview” package, the initial relevant call stack during Save As for a markdown preview is:
The basic problem is that execution in the
Execution gets stuck here waiting for promises that are never resolved, thus the save never happens. It just silently fails. The In the problematic case, the default language of “text” is used. The promise function in this case is The
In the problematic case, the second path is taken. Instead of resolving the promise via the Here is a patch that works, though I am not sure whether or not it is the ideal fix. Whether it is the ideal fix or not probably depends on whether or not we should expect tokenization to enter a
If we want to start chasing down the rabbit hole of whether or not the https://github.com/atom/atom/blob/master/src/text-editor.js To see the https://github.com/atom/atom/blob/master/src/text-mate-language-mode.js Look at |
That's not true for me. I specify the language for each block and it still won't save. Might be due to some languages not being detected, though. |
I have the same issue and want to add some more insights: The described workaround works when using |
Any suggestions for a workaround? Seems to still be an issue with the latest atom. |
My workaround for now is to use VSCode with this plugin: https://marketplace.visualstudio.com/items?itemName=manuth.markdown-converter |
I have same issue . Using latest atom on windows 10. Neither copying nor saving html from markdown-preview. |
Add me to the list 100% reproducible. Remove fenced code blocks and the feature works fine. Same result on Windows and MacOS. |
Same on Ubuntu 18 these days. |
The workaround with specifying a language on a code block works for me, as long as it's not " |
Same for me with 1.42 on Debian. |
Windows with 1.42, works when syntax highlighting c/cpp code blocks, but not with java. |
…g in Atom markdown preview: atom/markdown-preview#552
Using atom 1.43.0 on Windows 10. It was breaking on: '''nonsense Actually fixed it for me. |
Using 1.50.0 on Win 10 |
Add me to the list. Still reproducible in version 0.160.2 on Windows 10. Wow, 647 days. Its been a while folks. |
same on Ubuntu 20, even after reset by:
now, versions:
Please please any suggestions of fixing this, I need atom markdown because some other markdown always has issues like recongnize list nested code block etc... |
Alternatively, I would suggest looking at markdown-preview-plus. It works stably as I can see. |
Still not working in 2021. Maybe its time to quit Atom Editor? 🤔 |
Still the same on Atom v1.58.0 x64 for Windows. |
I feel the same but at the same time - everyone's free to file a PR, right? ;) |
The solution by @ShaneHoran works for me in Atom 1.58.0 on windows. |
Edits by @rsese to add new details based on #552 (comment)
Prerequisites
Description
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 just after the update to
v. 1.32.21.32.0 and the restart of Atom. atom/atom#17985 perhaps related?Steps to Reproduce
Expected behavior:
HTML file get saved and opened in new pane in Atom.
ctrlc-c or right-clicking the preview pane and selecting
Copy As HTML
will copy the preview in HTML for pasting.Actual behavior:
Files is not saved nor opened. The save as dialog opens but nothing is saved.
ctrlc-c or right-clicking the preview pane and selecting
Copy As HTML
doesn't do anything.Reproduces how often:
Every time if the file has a fenced code block
Versions
Additional Information
Last worked in 1.31.2 so maybe atom/atom#17985 is related?
This issue appears to be the exact replica of this old issue : #524
The text was updated successfully, but these errors were encountered: