]> git.proxmox.com Git - proxmox-widget-toolkit.git/commit
integrate marked as markdown parser
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Jun 2021 12:57:20 +0000 (14:57 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Jun 2021 13:19:29 +0000 (15:19 +0200)
commit51a2f11c6bb48a00b77c1624ea2ee3bcfa511133
treec9a896cae4d28ab231ca91dc8f17328f069fb4dd
parent00cbb47e09a4d378f1cdc74b7df926e8e1b8cbce
integrate marked as markdown parser

Define our own, rather minimal interface so that we change the parser
under the hood if ever needed, I already did so once during
evaluating this, as first I checked out Snarkdown[0], which is really
nice for the few lines of code it needs, but is a bit to limited for
the use case.

Currently marked[1] is used, provided by the libjs-marked Debian
package.

For now statically link the marked parser in on built time to avoid
the need to add new directories to serve in our pve/pmg/pbs proxies.
This is a bit ugly but can be cleaned up afterwards transparently
too.

We sanitize the produced HTML ourselves (most MD JS parser/renderer
don't do that) by creating a real, but not active, DOM tree and
recursively prune bad nodes/attrs from it and let it spit out HTML
again at the end. While a tad inefficient it really won't matter for
our use case, as the notes/comments we render are only a few KiB of
text and it's done on the client side anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/control
debian/copyright
src/Makefile
src/Parser.js [new file with mode: 0644]
src/css/ext6-pmx.css