Created attachment 118739 [details] screenshot Markdown can't display properly in the preview window, but it can open correctly in browser. please read the attachment for the screenshot
Interesting problem. For some reason the preview is shown as plain text, rather than as rendered HTML. I don't see this, here. Therefore, first question, how old exactly is the build you are using? (It is a development build, and the preview-functionality was added in this development cycle - possibly you are using an intermediate state, where the preview functionality was still buggy). If updating to a more recent snapshot does not help: 1) Do you see the same problem for "R Console" preview mode? 2) Does rk.show.html() work for you, when used with a local HTML file? Regards Thomas
How old exactly is the build you are using? I am using the last snapshot. It worked fine before the snapshot "a new export plugin". 1) Do you see the same problem for "R Console" preview mode? Yes, it works fine for "non-markdown" 2) Does rk.show.html() work for you, when used with a local HTML file? Yes, rk.show.html() works fine.
(In reply to Adley from comment #2) > How old exactly is the build you are using? > I am using the last snapshot. > It worked fine before the snapshot "a new export plugin". > > > 1) Do you see the same problem for "R Console" preview mode? > Yes, it works fine for "non-markdown" > > 2) Does rk.show.html() work for you, when used with a local HTML file? > Yes, rk.show.html() works fine. sorry for typo, 1) Do you see the same problem for "R Console" preview mode? No, it works fine for "non-markdown"
Created attachment 118763 [details] File generated by preview
I found something. It work properly after I removed the attributes "xmlns="http://www.w3.org/1999/xhtml" from <html xmlns="http://www.w3.org/1999/xhtml"> in output.html regards
Interesting observation. But for me, the xmlns-line does not cause any trouble, and I'm not sure, why it should. Sorry, if I need to insist: How *exactly* did you install RKWard. Is it directly from git? Or did you download a package? If so, where from, exactly? Also, the output of rk.sessionInfo() may be useful, as this could be a bug in Qt/KDE libraries, and so I'd like to know the version numbers of those. Finally, I was not asking specific enough with question number 2: Does rk.show.html() work, correctly, when pointed to the preview file (without removing the xmlns)?
Created attachment 118778 [details] rk.sessionInfo() For question number 2: rk.show.html(), Preview->R Markdown and Preview->R Console are the same; They can't work properly to the "output.html", but Preview->R Console shows a message: Warnings or Errors: Error in attr(exprs, "srcref")[[i]] : subscript out of bounds I think it means the attr "xmlns". Yes, you right. I think it might be related to my installation steps, since it works in kdevelop without removing the "xmlns". My installation steps as below: Fist, I list all the dependencies I installed. kf5-kdewebkit-devel.x86_64 kf5-ktexteditor-devel.x86_64 kf5-kdoctools-devel.x86_64 R-devel.x86_64 extra-cmake-modules.noarch qt5-qtscript-devel.x86_64 kf5-knotifications-devel.x86_64 kf5-kxmlgui-devel.x86_64 kf5-kwidgetsaddons-devel.x86_64 kf5-kdbusaddons-devel.x86_64 kf5-kconfigwidgets-devel.x86_64 kf5-ki18n-devel.x86_64 kf5-kwindowsystem-devel.x86_64 kf5-kcrash-devel.x86_64 get the snapshot from github kde mirror 1. mkdir build; cd build 2. cmake /home/user/rkward-master/ -DR_LIBDIR='/home/user/R/x86_64-redhat-linux-gnu-library/3.5' 3. make 4. make install
Ok, thanks, at least the pattern makes a bit more sense, now. The subscript out of bounds on console preview simply means you did not have statment (only perhaps comments) in the script. I'll try to improve that error message, but it's something all different. Could you run file --mime-type -b output.html on the preview file, before and after removing the "xmlns"? For me it shows "text/html" in both cases, but I suspect it will show something else for you.
Created attachment 118784 [details] file mime type They are the same "text/html" Thanks.
I'll have to admit, I don't quite get it. What I suspect is at play, is that somehow your system is configured to open XHTML files as text. You may want to check the File Associations section in your System Settings, particularly the "Embedding" tab. *However*, I tried reproducing your issue, here, by fiddling with these settings, and failed. You can probably "fix" the problem, by removing the string "KPartsIntegration | " from rkward/windows/rkhtmlwindow.cpp, as this will limit our HTML window to always showing rendered HTML, instead of an appropriate KPart (in this case a ktexteditor part). I'm not quite sure what side-effects this might be causing, though.
removing the string "KPartsIntegration | " from rkward/windows/rkhtmlwindow.cpp seems not work. I installed RKWard in a new virtualbox images, still can't display properly. It's seems hard to figure out in a short time.
> removing the string "KPartsIntegration | " from rkward/windows/rkhtmlwindow.cpp seems not work. Are you sure? The thing you have there is clearly a katepart, and I absolutely do not see where else it would come from. Please double check whether you are actually running the fresh-compiled binary: run "(sudo) make install" after "make", and start rkward with a full path to the binary.
I uploaded my whole process to youtube. https://www.youtube.com/watch?v=vRoZGoIAnkQ Thanks
Hi! Thanks for the video. What I *believe* is happening is that your rkward is getting installed to /usr/local/bin/rkward but you *probably* also have /usr/bin/rkward from an earlier installation. Thus, when you type "rkward", the old installation will be started. Try "which rkward", or start as "/usr/local/bin/rkward", explicitly!
Created attachment 118881 [details] which_rkward Hi, No other version of RKWard installed. I had reinstalled the OS before recorded the video. Thanks
Alright, I give up: What distribution (version) exactly, and how much space will I need in a virtual machine?
Hi, it seems can plugs and play the image: https://www.osboxes.org/fedora/ R version 3.5.2 (2018-12-20) Platform: x86_64-redhat-linux-gnu (64-bit) Running under: Fedora 29 (Workstation Edition) gnome dependencies: kf5-kdewebkit-devel.x86_64 kf5-ktexteditor-devel.x86_64 kf5-kdoctools-devel.x86_64 R-devel.x86_64 extra-cmake-modules.noarch qt5-qtscript-devel.x86_64 kf5-knotifications-devel.x86_64 kf5-kxmlgui-devel.x86_64 kf5-kwidgetsaddons-devel.x86_64 kf5-kdbusaddons-devel.x86_64 kf5-kconfigwidgets-devel.x86_64 kf5-ki18n-devel.x86_64 kf5-kwindowsystem-devel.x86_64 kf5-kcrash-devel.x86_64
I loaded the Fedora 29 image in VirtualBox, installed rkward (from git), and pandoc, and installed package rmarkdown inside rkward. Bug does not occur for me. Can you reproduce the bug in a fresh Fedora 29 image installed from https://www.osboxes.org/fedora/ ?
Hi, The issue occurred after system update. Please update the system with "sudo dnf update -y" (roughly hundreds of updates) and try again. Thanks
Git commit 9028a6413f77059ad812825c4c1e0eaab82a3626 by Thomas Friedrichsmeier. Committed on 20/03/2019 at 19:37. Pushed by tfry into branch 'master'. Allow to handle all supported content types, instead of hard-coded text/html . M +5 -4 rkward/windows/rkhtmlwindow.cpp https://commits.kde.org/rkward/9028a6413f77059ad812825c4c1e0eaab82a3626
Ok, I can finally see the bug. First problem is in fact that after the update QMimeDatabase will no longer recognize the file as text/html, but rather application/xhtml. Not sure, whether that is a bug or not, i.e. whether the problem will soon go away, or proliferate to all other systems... The rendered file has some contradicting information on what type it is. But in fact it is *not* valid XHTML. Which is where the next problem lingers: I have now changed the code so that QWebPage will *try* to render the file, *but* QWebPage is very strict about XHTML validity, and so it will report a validity error, instead of displaying anything. I'll probably have to find a way to force html-mode for XHTML, ugly as that will be. Hang on.
Git commit a0d72bb050c5e3280e0df8712d0b73ddf1a4e121 by Thomas Friedrichsmeier. Committed on 28/03/2019 at 08:46. Pushed by tfry into branch 'master'. Experimental workaround for 405386 . M +9 -1 rkward/windows/rkhtmlwindow.cpp https://commits.kde.org/rkward/a0d72bb050c5e3280e0df8712d0b73ddf1a4e121
Hi, Everything works excellent for me now. Should I close this ticket?