mfm.js icon indicating copy to clipboard operation
mfm.js copied to clipboard

MFM to HTML support

Open ThuHtooSan opened this issue 1 year ago • 4 comments

Do you have a plan to support MFM to HTML direct parsing? Currently, if I want to implement the MFM parser in my projects, I need to write my own encoder to convert the returned MFM tree to HTML.

I'm sorry to bother you but Discord link is dead and the forum no longer exists so...

ThuHtooSan avatar Feb 07 '24 19:02 ThuHtooSan

Hi with the package @opera7133/mfmp you can

import { toHtml } from '@opera7133/mfmp' import * as mfm from 'mfm-js'

toHtml(mfm.parse(MFM_STRING_HERE))

gabboman avatar May 01 '24 20:05 gabboman

@gabboman Thank you! I'll check it out.

ThuHtooSan avatar May 04 '24 11:05 ThuHtooSan

its a bit wonky. In wafrn I ended up disabling it. a lot of custom clasees, and broken links

gabboman avatar May 04 '24 11:05 gabboman

Oh is it? When I checked (the code) earlier, it didn't look like it has custom classes though. But I do see some custom dataset attributes. ig I have to find another one then :)

ThuHtooSan avatar May 04 '24 11:05 ThuHtooSan