Is there a way to preview your comments?

I often find myself using latex in my comments and thus need to check off site that it renders before posting.

New Answer
New Comment

1 Answers sorted by

gjm

May 10, 2021

50

In your profile settings there's a checkbox that switches between WYSIWYG and Markdown, and another that switches between two different WYSIWYG comment editors, one older and one newer. I am using the "new" WYSIWYG one, and it shows LaTeX just fine while composing. Obviously the pure-Markdown comment editor doesn't do that. I don't remember what the "old" WYSIWYG editor does.

However, the "new" WYSIWYG editor has annoying bugs (or perhaps interactions with quirks of my browser setup?) which mean that every now and then it will decide that hitting the space bar means it should throw away the most recently typed equation and everything after it in the paragraph, or move my cursor back to the start of the comment and make every letter I type a new paragraph. (I think both are the result of mishandling some internal error condition.)

I put up with these bugs because otherwise it behaves nicely and I hope that some day the bugs will be fixed; the new WYSIWYG comment editor is still kinda-new-ish. Your tolerance for bugs may differ from mine.

However, the "new" WYSIWYG editor has annoying bugs (or perhaps interactions with quirks of my browser setup?) which mean that every now and then it will decide that hitting the space bar means it should throw away the most recently typed equation and everything after it in the paragraph, or move my cursor back to the start of the comment and make every letter I type a new paragraph. (I think both are the result of mishandling some internal error condition.)

I think these bugs should be fixed now, but if you still run into them, please let me know! I thought we had fixed these ~2-3 months ago.

2gjm3y
I have definitely encountered them in the last week or two. I just did the following test. After the line above, I entered [asterisk] [space] (so I'm now in a bullet point), some text, then ctrl-4 to enter the LaTeX editor, entered some mathematics, hit enter to get out of the LaTeX editor, and pressed the space bar. At that point, in the console I got this: That's the console window in which I started my browser, not the browser's Javascript console. In the Javascript console I got "Editor crashed", then Uncaught CKEditorError: H is null // Read more: ..." and a kinda-traceback, then "Editor was restarted". But apparently once restarted it's a bit confused about its internal state. Here's the kinda-traceback: (It's actually presented in table form, function names on the left, filenames and line numbers on the right.) I get these all the time.
2habryka3y
Oh, interesting. That is a totally different bug from what I had encountered previously. Will look into it. Somehow I've never run into this.
5gjm3y
So the trouble seems to be in liststyleediting.js, function upcastListItemStyle, which has a line const listStyle = listParent.getStyle( 'list-style-type' ) || DEFAULT_LIST_TYPE and at this point listParent is null. (It's called H after minification.) This is a list that isn't inside another list, so maybe it's correct that listParent is null (in which case the code should say something more like listParent && listParent.getStyle(...) || ... or, to be more modern about it, listParent?.getStyle?.(...) || ...); or maybe listParent is meant to be the whole paragraph or the whole comment or something, in which case the bug is in whatever made listParent be null. (I don't know whether you are in a position to change the code -- I think you're using someone else's editor component -- so maybe this is no help. It might also be no help by being wrong :-).)

Nice Thanks, now My only issue is this: I would prefer pure markdown for writing posts and the new WYSIWYG for commenting. But after playing with it it seems that it remember your settings for posts, so you can switch back before clicking create post, and then you are golden :). Thanks a lot