Bug in bookmarklet on web page that have HTML 3.2 doctype

114 Views Asked by At

I have bookmarklet that create REPL with Scheme language using my Scheme based lisp in JavaScript and jQuery Terminal.

The bookmarklet is not important it just create terminal the link to the bookmarklet is on GitHub:

https://github.com/jcubic/lips/blob/devel/examples/bookmark.js

, that works fine on any website but when I've run it on Scheme SRFI page that have this doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

the terminal don't work correctly. What's different is that when I type "(lambda ()" and move cursor over second open bracket, the next closing bracket and in next line.

Screenshot

It works perfectly fine on any other website. Can any expert explain what is happening and if there is a way to add something to make it work? The page have almost no CSS. So there are no conflicts and I've added scoped class names so each generic name have cmd- and terminal- prefix in class name just to be sure that are no conflicts.

Sorry, no simple and minimal example. Maybe you will be able to answer just looking at dev tools with actual code.

I run this on Fedora GNU/Linux with latest Chrome browser.

1

There are 1 best solutions below

3
Nux On

It's expected to work weird with old HTML. Not sure why do you care about that old page, but you might want to read about quirks mode https://en.m.wikipedia.org/wiki/Quirks_mode