clarketm/hugo-elasticsearch

Please stop using remove-markdown

ralt opened this issue · 0 comments

ralt commented

The library has a bunch of pretty bad things:

  • It chokes on markdown tables
  • It replaces things it shouldn't.

For the 2nd one, see e.g.: https://github.com/stiang/remove-markdown/blob/master/index.js#L33

An example:

'foo < bar baz >'.replace(/<[^>]*>/g, '')
"foo "

Ideally, the library should use a markdown parser, but remove-markdown is pretty far from it, so I'd suggest outright removing its use instead.

That said, I do not have a replacement to suggest :) not trying to be a smartass, really, just thought I'd give my opinion on a lib I had to monkey patch out of hugo-elasticsearch when adding it to my site.

Cheers,