pulsar-edit / pulsar

A Community-led Hyper-Hackable Text Editor
https://pulsar-edit.dev
Other
3.09k stars 131 forks source link

asciidoc-preview in pulsar-editor opens blank window with no text rendered, same occurs in latest atom 1.63 (Markdown IS rendered in pulsar v1.100) #256

Open ianwillie opened 1 year ago

ianwillie commented 1 year ago

Thanks in advance for your bug report!

What happened?

While editing an asciidoc text file in pulsar v1.63, window opens but text does not render. See screenshots attached. I have found that the same bug occurs in the latest flatpak version of atom but works fine in the previous release. These releases are listed below. This was tested with the file test.html.adoc . (However, I cannot attach it because adoc files are not supported by github apparently so remove the terminal ".txt".) So it seems that some change has occurred in both pulsar 1.63 and atom 1.63 which prevents asciidoc-preview rendering text. I use asciidoc a lot for websites because the syntax is concise and quick to type for textual work.

asciidoc-preview renders correctly in this flatpak version of atom: sudo flatpak update --commit=cea629ca495e72d577eae4e64bff902ead937564bc67be7fd6d584554be3de36 io.atom.Atom Atom 1.60.0 x64 from spash screen. Electron 9.4.4, Chrome 83.0.4103.122, Node v12.14.1 Release notes from github 1.60.0 atom-build released this (2022) Mar 8 v1.60.0 03c9ad9

asciidoc-preview opens a blank window with no rendering in this version of atom: Commit: 04c0909c66741eaedd959d013f18df74f6244ba9455914f85511e26601d23e01 Parent: cea629ca495e72d577eae4e64bff902ead937564bc67be7fd6d584554be3de36 Subject: Change xprop archieve (d351a5c4) Date: 2022-12-21 20:31:23 +0000 Atom splash screen: 1.63.1 x64 Electron 11.5.0, Chrome 87.0.4280.141, Node v12.18.3 Release notes from github 1.63.1 released this (2022) Nov 23 v1.63.1 539d250

TEST.html.adoc.txt

Which OS does this happen on?

🐧 Arch based (Manjaro, Garuda, etc.)

OS details

Manjaro latest versions

Which CPU architecture are you running this on?

64-bit(x86_64)

What steps are needed to reproduce this?

Open pulsar. Open file test.html.adoc (attached but remove terminal ".txt" containing these 5 lines: ` = TEST asciidoc rendering

Test asciidoc rendering.

`

Install asciidoc-preview Open above file. With cursor in file press Ctrl+Shift+A Window opens but text does not render.

Repeat the procedure with the two different flatpak versions of atom listed above to see the same bug appear in the l.63 version detailed above.

Additional Information:

Screenshot: Pulsar 1.63 showing no asciidoc-preview rendering of text Pulsar1_63NoRendering

Screenshot: Atom 1.63 showing no asciidoc-preview rendering of text Atom1_63NoRendering

Screenshot: Atom 1.60 showing full asciidoc-preview rendering of text Atom1_60CorrectRendering

ianwillie commented 1 month ago

This worked on my setup too. But I used Package Manager > Install then entered "savetheclocktower/atom-asciidoc-preview" as the name of the package.

greyp9 commented 1 month ago

This ought to get things working again.

Screenshot 2024-05-21 at 14 56 36

And it does! Thanks very much, @savetheclocktower .

ianwillie commented 1 month ago

@savetheclocktower I wonder if the brilliant change that you made adding @attached() to line 24 in .pulsar/packages/asciidoc-preview/lib/asciidoc-preview-view.coffee is in any way related to the bare "super" in

    constructor: ({@editorId, @filePath}) ->
    super
    @emitter = new Emitter
    @disposables = new CompositeDisposable
    @loaded = false
    # NOTE: Don't know why this fixes it. Don't know how `attached` previously
    # got called, because I don't see a code path that would've done it either
    # within this repo or within Pulsar. But it seems to fix the problem.
    @attached()

in some versions of the coffeescript transpiler the bare super produces an error because the latest coffeescript expects "super()" or "super arguments..." and chokes on "super" alone. I found that using one transpiler, which one I can't remember, but the error stopped the js file being produced at all: "error: unexpected new line" . In another "AsciiDocPreviewView.super.constructor.apply(this, arguments);" was added as expected.

see https://stackoverflow.com/questions/49858400/unexpected-indentation-in-coffee-script and http://coffeescript.org/announcing-coffeescript-2/ "£In CoffeeScript 2, “bare” super (calling super without arguments) is now no longer allowed, and one must use super() or super arguments... instead."

I cannot see how this is connected but it is odd that the transpiling error appears in the same place as your insertion which made the package render properly. Many thanks for that!

I have compiled the package to all JS and it seems to work fine.

dadreggors commented 1 month ago

@confused-Techie can you give more details on pulsar-cooperative ? Maybe links to docs showing what that even is?

dadreggors commented 1 month ago

I added this to pulsar-cooperative @confused-Techie, let's see where it goes.

Please feel free to add comments on that issue/request to add this package.

https://github.com/pulsar-cooperative/.github/issues/3