-
Notifications
You must be signed in to change notification settings - Fork 6
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
divs/spans break WYSIWYG in FireFox #406
Comments
Looking at the raw code for that link, it's a mess of empty divs and spans that are arbitrarily scattered throughout the text. |
Found another example in the database which has divs and cannot be edited.
this might be unrelated to pdf2htmlex, since I don't see any particular markers about |
The upstream static file is full of random divs and spans. https://karma-beta.s3.amazonaws.com/html/finalsclub-hccg-reportpdf-5-20-137857.html Given the new sanitizer and upload process, it will be worth trying to upload the PDF as a new note and see if the problem persists. If not, it might be good to download the upstream PDFs and run them through the usual upload process if that is feasible. If that involves pushing to gdrive and pulling from gdrive and running through pdf2htmlex and sanitizing and sanitizing, that might not be worthwhile as a data migration. At that point, it might be worthwhile to post process notes that contain span/div in the database after the data migration is completed. |
queue appears to have finished, but I can't upload any notes. Nothing seems to be happening with celery worker or beat when I upload a new note. |
alright, closed a bunch of my zombie AMQP connections and added the |
ah! but the plain text file that I just uploaded has divs and spans in it! Absolutely confirmed this is not due to pdf2htmlEX. |
Yeah, this uploaded text file with spans cannot be edited either. The WYSIWYG seems non functional, showing straight HTML. It might be time to follow the work flow and see where those span tags came in. |
I can delete content in the straight HTML editor mode. I deleted all spans, but left So the WYSIWYG is back to functional once I remove the |
I added the I went to edit the note again, and the editor is back to plain/text mode, no WYSIWYG, and the buttons do not work. |
Removed Added This editor is not idempotent or else we are interfering with the results somehow. |
It's google docs that's adding a ton of spans and divs everywhere. pdb in
This is just a simple text file, not even RTF, but Google Docs (which yields the |
Alright I need to let this cook on the back burner. Do we want to strip divs and spans? Will that mess everything up? I swear I've searched the junk out of the WYSIHTML issues and found nothing about problems with |
Also the I kind of like this happy accident, but it should be wrapped with header formatting or something. |
Interestingly, WYSIHTML notes in its Readme that it supports
This sounds almost exactly like the situation when a span or div is present, although that should have nothing to do with browser version. |
Toying with the example found at http://www.wysihtml.com/ . There's a button to switch to raw HTML. When using colors, they have spans with properties. I decided to remove properties from all of the spans so it was Somehow our implementation of WYSIHTML is flawed, because it cannot handle spans in this way. |
There are different rulesets. This might somehow be a difference. We're using It isn't clear what the front page http://www.wysihtml.com/ example is using. http://voog.github.io/wysihtml/examples/simple.html is clearly using I notice it says
I'm curious if that refers to the There's a span definition in the parser we're using. I don't see anything wrong there. |
I injected a WYSI/HTML toggle button. I cannot use it to to HTML, as that action triggers a whole page refresh. This is oddly familiar from when I see HTML but try to use buttons. Normally, in WYSIHTML's proper HTML view, the buttons are disabled. When I see the accidental HTML view due to a span, the buttons are enabled but using them causes a refresh (as if, perhaps, it is trying to switch from HTML to WYSI mode?). Might be a red herring, but I'm getting the strong impression that this entire page reload thing is interfering with my troubleshooting. |
When I click When I'm seeing HTML view, highlight something, and click B to embolden it, sure enough I see Then again it might be going down the way wrong path. The spans shouldn't cause HTML view in the first place. |
I noticed that Unfortunately it seems to be undefined when WYSI is working. ugh. grasping at straws. Although it does beg the question why have it? |
I'm getting very odd behavior trying to drop breakpoints in the note_base code. Some breakpoints drop down a few lines when I click them. Any breakpoint added prior to line 81 highlighted above doesn't stop execution at all. I think I'm going to need to switch to Chrome to poke at this better. |
Google Chrome 40.0.2214.111 on Mint Linux lets me debug all the points the way I would expect. Yet, the same version does not break on spans. The WYSIWYG is working just fine in Chrome! Kind of. So here's the weird thing: FireFox 35.0.1 on Mint Linux does not show the WYSIWYG properly when spans are present. Yet the main website works fine on the same FireFox browser. |
Okay, strange interaction. In Google, I enclose text with In FireFox, I enclose text with In Chrome, this whole process works start to finish. The last of the quadfecta: In FireFox, I enclose text with in the WYSI. I reload the page in Chrome, where the spans are visible as escaped in the note. I edit the note, editor works just fine and the span is completely ignored and missing from the WYSI (as desired)! I save the note without changes in Chrome, and the escaped is gone from the note view. Reload the page and click the editor again, but the is still there breaking the WYSI. How can entering |
The first test case in the original comment is also editable in Chrome without any issue. |
Maybe the database will reveal a difference? No spans. FireFox added span. Chrome added span. So why is FireFox okay if Chrome adds the span but not FireFox? |
Maybe there's something being cached somehow in FireFox? If Chrome adds the span, FireFox would not have the cache. If FireFox adds it, it would have the cache. Close all private windows. Start a new private window with a fresh cache. Login. Edit the note to add spans, save. Close all private windows. Start a new private window with a fresh cache. Login. Edit the note. Broken WYSI, flat HTML showing. Alright so it isn't caching. |
I am running Chrome on a separate computer, using a 10.x.x.x network address to access the site. Meanwhile I'm running FireFox on the same computer, using a 127.0.0.1 network address to access the site. Let's try FireFox on my separate computer using 10.x.x.x. Separate computer is also running FF 35.0.1 on Linux Mint, so that is consistent. New private window. Login to site running at 10.x.x.x. Visiting page with Not related to networking. |
FF 35.0.1 on Windows 8. WYSI is broken due to SPAN. Not limited to Linux FF 35.0.1. Chrome 40.0.2214.94 on Windows 8. WYSI works as expected even with SPAN. IE 11.0.9600.17498 on Windows 8. WYSI works as expected even with SPAN. FireFox just updated to 36.0, so let's give that a go. FF 36.0 on Windows 8. WYSI is broken due to SPAN. Alright, so FF, either version 35.0.1 or 36.0 on either Windows or Linux, does not use the WYSIHTML properly if there is a span in the text on our site. However, the wysihtml.com example works just fine with divs and spans in FF. This is going to be a very specific bug to try tracking down at this point. Need to check in with @AndrewMagliozzi to see if this worth spending any more time on. |
Particular test case:
/note/harvard/reason-and-faith-in-the-west/resumepdf-5-27-43979
That note allows me to open the editor, but it's all raw HTML in the editor. If I try to embolden some plain text, it just removes the editor window, refreshes the page, and nothing changed.
No errors on console besides
TypeError: m.getComputedStyle(...) is null ... wysihtml5x-toolbar.min.js:5
, but this error is relatively common on pages that work just fine. No errors on the server console.This problem was originally noticed in #402 but I conflated a few different problems together in that ticket. I thought they might have all been resolved, but it appears not to be the case.
The text was updated successfully, but these errors were encountered: